405925: GYM102157 6 Kitchen Plates
Description
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
![](https://espresso.codeforces.com/448c800930df39ce134aace70f8fe50d3a940535.png)
![](https://espresso.codeforces.com/005fc2d24e899671e8e8f8b5087516dc69b6d1f5.png)
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.
OutputThe 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
ExamplesInputD>B A>D E<C A>B B>COutput
ECBDAInput
B>E A>B E>A C<B D<BOutput
impossible