{"problem":{"name":"6. Kitchen Plates","description":{"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 ","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF102156"},"statements":[{"statement_type":"Markdown","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## Input\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\n## Output\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[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**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.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF102156","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}