Problem H. Hamming sphere

Author:A. Baranov   Time limit:1 sec
Input file:Standard input   Memory limit:256 Mb
Output file:Standard output  

Statement

Four strings of the same length are composed of four characters ('A', 'B', 'C' and 'D').

Your program must find such a string that Hamming distance from it to any strings of original set is the same.

Moreover, such string must have the same length as the original strings.

If there are many answers, select any string that gives the minimum of distance.

Input format

Input data contains four original strings.

Output format

Output data must contain answer or empty string, if answer does not exist.

Constraints

Length of original strings is from 1 to 32.

Sample tests

No. Standard input Standard output
1
ABCDABCD
AABBAABB
AACCABCD
ABCDCCDD
AABDCACD
2
AAA
CBC
BCD
DDB

0.068s 0.012s 13