- Time limit: 1.00 s
- Memory limit: 512 MB
Let denote the edit distance between strings and , which is the minimum number of editing operations needed to transform into . The allowed editing operations are as follows:
- add one character
- remove one character
- change one character
For example, , because we can remove the letter and change the first letter.
Given three strings , and , your task is to find a string such that is minimum.
Input
There are three lines that contain the strings , and . Each string consists of characters .
Output
Print a string that consists of characters and minimizes the edit distance. If there are several such strings, print any of them.
Constraints
Example
Input:
ABBA AYBABTU BASTU
Output:
ABABTU