{"raw_statement":[{"iden":"statement","content":"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. \n\nFor example: the sizes of these plates\n\nThe 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. \n\nThe 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\n\n"},{"iden":"input","content":"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. "},{"iden":"output","content":"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"},{"iden":"examples","content":"InputD>B\nA>D\nE<C\nA>B\nB>C\nOutputECBDA\nInputB>E\nA>B\nE>A\nC<B\nD<B\nOutputimpossible\n"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ P = \\{A, B, C, D, E\\} $ be the set of plate labels.  \nLet $ S \\subseteq P \\times \\{<, >\\} \\times P $ be a set of 5 strict binary comparison statements, where each statement is of the form $ (X, \\text{op}, Y) $ with $ X \\ne Y $ and $ \\text{op} \\in \\{<, >\\} $, meaning $ X < Y $ or $ X > Y $.\n\n**Constraints**  \n1. Each statement in $ S $ compares two distinct plates.  \n2. No two plates are equal (all sizes are distinct).  \n3. $ |S| = 5 $.  \n\n**Objective**  \nFind a total order $ \\pi = (p_1, p_2, p_3, p_4, p_5) $ of $ P $ such that for every statement $ (X, \\text{op}, Y) \\in S $:  \n- If $ \\text{op} = < $, then $ \\pi^{-1}(X) < \\pi^{-1}(Y) $,  \n- If $ \\text{op} = > $, then $ \\pi^{-1}(X) > \\pi^{-1}(Y) $.  \n\nIf no such total order exists, output *impossible*.  \nIf multiple exist, output any one.","simple_statement":"You are given 5 plates labeled A, B, C, D, E.  \nYou are given 5 comparisons like \"A<B\" or \"C>D\", each telling you which of two plates is smaller or larger.  \nSort the plates from smallest to biggest.  \nIf the comparisons contradict each other, print \"impossible\".  \nIf multiple valid orders exist, print any one.","has_page_source":false}