{"raw_statement":[{"iden":"statement","content":"Dreamoon, who doesn't have a girlfriend, often goes for a walk along some streets in Taipei while thinking about problems from algorithm competitions. Unfortunately, there are so many couples acting lovey-dovey on the street that Dreamoon can not focus on thinking about those problems.\n\nOne day, despite the love birds everywhere, Dreamoon discovered a problem input containing an integer sequence: a1, a2, a3, ..., aN.\n\nDreamoon thought: because I'm single, every pair of consecutive numbers should have a large difference! This is, Dreamoon wants to reorder the sequence to make the value  as large as possible.\n\nSo Dreamoon turned on Drazil, who does have a girlfriend, and forced Drazil to fulfill the above condition by reordering the integer sequence. Please help poor Drazil  > _ < \n\nThe input consists of two lines. The first line contains an integer N. The second line consists of N integers a1, a2, ..., aN.\n\nOutput a single line consisting of N integers, denoting the integer sequence a after reordering. For this reordering, the value  must be the largest possible among all reorderings of the input sequence. If there are several possible answers, output any one of them.\n\n"},{"iden":"input","content":"The input consists of two lines. The first line contains an integer N. The second line consists of N integers a1, a2, ..., aN.  2 ≤ N ≤ 2 × 105   - 109 ≤ ai ≤ 109 "},{"iden":"output","content":"Output a single line consisting of N integers, denoting the integer sequence a after reordering. For this reordering, the value  must be the largest possible among all reorderings of the input sequence. If there are several possible answers, output any one of them."},{"iden":"examples","content":"Input33 1 5Output3 5 1Input4-1 -1 1 1Output1 -1 1 -1"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ N \\in \\mathbb{Z}^+ $ be the length of the sequence.  \nLet $ A = (a_1, a_2, \\dots, a_N) $ be a sequence of real numbers.\n\n**Objective**  \nFind a permutation $ B = (b_1, b_2, \\dots, b_N) $ of $ A $ that maximizes:  \n$$\n\\sum_{i=1}^{N-1} |b_i - b_{i+1}|\n$$\n\n**Constraints**  \n- $ 1 \\leq N \\leq 100 $  \n- $ a_i \\in \\mathbb{R} $ for all $ i \\in \\{1, \\dots, N\\} $ (typically integers in practice)","simple_statement":"Reorder the array to maximize the sum of absolute differences between consecutive elements.","has_page_source":false}