6. Kitchen Plates
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

You are given 5 different sizes of kitchen plates. Each plate is marked with a letter A, B, C, D, or E. You are given $$$5$$$ statements comparing two different plates, you need to rearrange the plates from smallest size to biggest size.

For example: the sizes of these plates

Input

The input consist of $$$5$$$ lines. In each line there will be $$$3$$$ characters, the first and last character will be either A, B, C, D, or E and the middle character will be either > or < describing the comparison between two plates sizes. No two plates will be equal.

Output

The output consist of 5 characters, the sorted order of balls from smallest to biggest plate. Otherwise, if the statements are contradicting print impossible. If there are multiple answers, print any of them

Examples
Input
D>B
A>D
E<C
A>B
B>C
Output
ECBDA
Input
B>E
A>B
E>A
C<B
D<B
Output
impossible