{"raw_statement":[{"iden":"statement","content":"Young Timofey has a birthday today! He got kit of _n_ cubes as a birthday present from his parents. Every cube has a number _a__i_, which is written on it. Timofey put all the cubes in a row and went to unpack other presents.\n\nIn this time, Timofey's elder brother, Dima reordered the cubes using the following rule. Suppose the cubes are numbered from 1 to _n_ in their order. Dima performs several steps, on step _i_ he reverses the segment of cubes from _i_\\-th to (_n_ - _i_ + 1)\\-th. He does this while _i_ ≤ _n_ - _i_ + 1.\n\nAfter performing the operations Dima went away, being very proud of himself. When Timofey returned to his cubes, he understood that their order was changed. Help Timofey as fast as you can and save the holiday — restore the initial order of the cubes using information of their current location."},{"iden":"input","content":"The first line contains single integer _n_ (1 ≤ _n_ ≤ 2·105) — the number of cubes.\n\nThe second line contains _n_ integers _a_1, _a_2, ..., _a__n_ ( - 109 ≤ _a__i_ ≤ 109), where _a__i_ is the number written on the _i_\\-th cube after Dima has changed their order."},{"iden":"output","content":"Print _n_ integers, separated by spaces — the numbers written on the cubes in their initial order.\n\nIt can be shown that the answer is unique."},{"iden":"examples","content":"Input\n\n7\n4 3 7 6 9 1 2\n\nOutput\n\n2 3 9 6 7 1 4\n\nInput\n\n8\n6 1 4 2 5 6 9 2\n\nOutput\n\n2 1 6 2 5 4 9 6"},{"iden":"note","content":"Consider the first sample.\n\n1.  At the begining row was \\[2, 3, 9, 6, 7, 1, 4\\].\n2.  After first operation row was \\[4, 1, 7, 6, 9, 3, 2\\].\n3.  After second operation row was \\[4, 3, 9, 6, 7, 1, 2\\].\n4.  After third operation row was \\[4, 3, 7, 6, 9, 1, 2\\].\n5.  At fourth operation we reverse just middle element, so nothing has changed. The final row is \\[4, 3, 7, 6, 9, 1, 2\\]. So the answer for this case is row \\[2, 3, 9, 6, 7, 1, 4\\]."}],"translated_statement":[{"iden":"statement","content":"今天是年轻蒂莫菲的生日！他从父母那里收到了一套由 #cf_span[n] 个立方体组成的礼物。每个立方体上都写有一个数字 #cf_span[ai]。蒂莫菲将所有立方体排成一行，然后去拆其他礼物了。\n\n此时，蒂莫菲的哥哥迪马按照以下规则重新排列了这些立方体。假设立方体按顺序编号为 #cf_span[1] 到 #cf_span[n]。迪马执行若干步骤，在第 #cf_span[i] 步中，他将从第 #cf_span[i] 个到第 #cf_span[(n - i + 1)] 个立方体之间的段反转。他持续执行此操作，直到 #cf_span[i ≤ n - i + 1]。\n\n执行完所有操作后，迪马自豪地离开了。当蒂莫菲回来时，他发现立方体的顺序已经被改变。请尽快帮助蒂莫菲，利用当前立方体的位置信息，恢复它们的初始顺序，挽救这个节日吧！\n\n第一行包含一个整数 #cf_span[n] (#cf_span[1 ≤ n ≤ 2·105]) —— 立方体的数量。\n\n第二行包含 #cf_span[n] 个整数 #cf_span[a1, a2, ..., an] (#cf_span[ - 109 ≤ ai ≤ 109])，其中 #cf_span[ai] 表示迪马改变顺序后，第 #cf_span[i] 个立方体上的数字。\n\n请输出 #cf_span[n] 个整数，用空格分隔——表示立方体在初始顺序时上的数字。\n\n可以证明答案是唯一的。\n\n考虑第一个样例。\n\n"},{"iden":"input","content":"第一行包含一个整数 #cf_span[n] (#cf_span[1 ≤ n ≤ 2·105]) —— 立方体的数量。第二行包含 #cf_span[n] 个整数 #cf_span[a1, a2, ..., an] (#cf_span[ - 109 ≤ ai ≤ 109])，其中 #cf_span[ai] 表示迪马改变顺序后，第 #cf_span[i] 个立方体上的数字。"},{"iden":"output","content":"请输出 #cf_span[n] 个整数，用空格分隔——表示立方体在初始顺序时上的数字。可以证明答案是唯一的。"},{"iden":"examples","content":"输入74 3 7 6 9 1 2输出2 3 9 6 7 1 4输入86 1 4 2 5 6 9 2输出2 1 6 2 5 4 9 6"},{"iden":"note","content":"考虑第一个样例。初始序列为 [#cf_span[2], #cf_span[3], #cf_span[9], #cf_span[6], #cf_span[7], #cf_span[1], #cf_span[4]]。第一次操作后，序列变为 [#cf_span[4], #cf_span[1], #cf_span[7], #cf_span[6], #cf_span[9], #cf_span[3], #cf_span[2]]。第二次操作后，序列变为 [#cf_span[4], #cf_span[3], #cf_span[9], #cf_span[6], #cf_span[7], #cf_span[1], #cf_span[2]]。第三次操作后，序列变为 [#cf_span[4], #cf_span[3], #cf_span[7], #cf_span[6], #cf_span[9], #cf_span[1], #cf_span[2]]。第四次操作时，我们仅反转中间元素，因此序列不变。最终序列为 [#cf_span[4], #cf_span[3], #cf_span[7], #cf_span[6], #cf_span[9], #cf_span[1], #cf_span[2]]。因此，本情况的答案为序列 [#cf_span[2], #cf_span[3], #cf_span[9], #cf_span[6], #cf_span[7], #cf_span[1], #cf_span[4]]。 "}],"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n \\in \\mathbb{Z}^+ $ be the number of cubes.  \nLet $ A = (a_1, a_2, \\dots, a_n) $ be the final sequence of numbers on the cubes after Dima’s operations.  \nLet $ A^{(0)} = (x_1, x_2, \\dots, x_n) $ be the initial sequence (to be recovered).\n\n**Operations**  \nDima performed $ \\left\\lfloor \\frac{n}{2} \\right\\rfloor $ steps. On step $ i $ (for $ i = 1, 2, \\dots, \\left\\lfloor \\frac{n}{2} \\right\\rfloor $), he reversed the segment from position $ i $ to position $ n - i + 1 $.\n\n**Objective**  \nRecover the initial sequence $ A^{(0)} $ such that applying the described sequence of reversals to $ A^{(0)} $ yields $ A $.\n\n**Key Insight**  \nThe transformation from $ A^{(0)} $ to $ A $ is a composition of reversals. Since each reversal is its own inverse, applying the same sequence of reversals to $ A $ will recover $ A^{(0)} $.\n\nThus, to invert Dima’s process, apply the same reversal operations to $ A $:  \nFor $ i = 1 $ to $ \\left\\lfloor \\frac{n}{2} \\right\\rfloor $, reverse the subarray $ A[i : n-i+1] $.\n\n**Final Objective (Mathematical Form)**  \nCompute $ A^{(0)} $ by applying the inverse transformation:  \n$$\nA^{(0)} = \\text{Reverse}_{\\left\\lfloor \\frac{n}{2} \\right\\rfloor} \\circ \\cdots \\circ \\text{Reverse}_2 \\circ \\text{Reverse}_1 (A)\n$$  \nwhere $ \\text{Reverse}_i(S) $ reverses the segment $ S[i : n-i+1] $ of sequence $ S $.","simple_statement":null,"has_page_source":false}