{"raw_statement":[{"iden":"statement","content":"Bill is a famous mathematician in BubbleLand. Thanks to his revolutionary math discoveries he was able to make enough money to build a beautiful house. Unfortunately, for not paying property tax on time, court decided to punish Bill by making him lose a part of his property.\n\nBill’s property can be observed as a convex regular 2_n_\\-sided polygon _A_0 _A_1... _A_2_n_ - 1 _A_2_n_,  _A_2_n_ =  _A_0, with sides of the exactly 1 meter in length.\n\nCourt rules for removing part of his property are as follows:\n\n*   Split every edge _A__k_ _A__k_ + 1,  _k_ = 0... 2_n_ - 1 in _n_ equal parts of size 1 / _n_ with points _P_0, _P_1, ..., _P__n_ - 1\n*   On every edge _A_2_k_ _A_2_k_ + 1,  _k_ = 0... _n_ - 1 court will choose one point _B_2_k_ =  _P__i_ for some _i_ = 0, ...,  _n_ - 1 such that\n*   On every edge _A_2_k_ + 1_A_2_k_ + 2,  _k_ = 0..._n_ - 1 Bill will choose one point _B_2_k_ + 1 =  _P__i_ for some _i_ = 0, ...,  _n_ - 1 such that\n*   Bill gets to keep property inside of 2_n_\\-sided polygon _B_0 _B_1... _B_2_n_ - 1\n\nLuckily, Bill found out which _B_2_k_ points the court chose. Even though he is a great mathematician, his house is very big and he has a hard time calculating. Therefore, he is asking you to help him choose points so he maximizes area of property he can keep."},{"iden":"input","content":"The first line contains one integer number _n_ (2 ≤ _n_ ≤ 50000), representing number of edges of 2_n_\\-sided polygon.\n\nThe second line contains _n_ distinct integer numbers _B_2_k_ (0 ≤ _B_2_k_ ≤ _n_ - 1,  _k_ = 0... _n_ - 1) separated by a single space, representing points the court chose. If _B_2_k_ = _i_, the court chose point _P__i_ on side _A_2_k_ _A_2_k_ + 1."},{"iden":"output","content":"Output contains _n_ distinct integers separated by a single space representing points _B_1, _B_3, ..., _B_2_n_ - 1 Bill should choose in order to maximize the property area. If there are multiple solutions that maximize the area, return any of them."},{"iden":"example","content":"Input\n\n3\n0 1 2\n\nOutput\n\n0 2 1"},{"iden":"note","content":"To maximize area Bill should choose points: _B_1 = _P_0, _B_3 = _P_2, _B_5 = _P_1\n\n![image](https://espresso.codeforces.com/2f6820e290c879f16d07d79d039cecea64b7cbb8.png)"}],"translated_statement":[{"iden":"statement","content":"Bill 是 BubbleLand 著名的数学家。由于他革命性的数学发现，他赚到了足够的钱建造了一座漂亮的房子。但不幸的是，由于未按时缴纳房产税，法院决定惩罚 Bill，让他失去一部分财产。\n\nBill 的财产可以看作是一个凸的正 $2n$ 边形 $A_0 A_1 \\dots A_{2n-1} A_{2n}, A_{2n} = A_0$，每条边的长度恰好为 1 米。\n\n法院拆除部分财产的规则如下：\n\n幸运的是，Bill 找到了法院选择的 $B_{2k}$ 点。尽管他是一位伟大的数学家，但他的房子非常大，计算起来很困难。因此，他请求你帮助他选择点，以便最大化他能保留的财产面积。\n\n第一行包含一个整数 $n$（$2 \\leq n \\leq 50000$），表示 $2n$ 边形的边数。\n\n第二行包含 $n$ 个互不相同的整数 $B_{2k}$（$0 \\leq B_{2k} \\leq n-1, k = 0 \\dots n-1$），用单个空格分隔，表示法院选择的点。如果 $B_{2k} = i$，则法院在边 $A_{2k} A_{2k+1}$ 上选择了点 $P_i$。\n\n输出包含 $n$ 个互不相同的整数，用单个空格分隔，表示 Bill 应选择的点 $B_1, B_3, \\dots, B_{2n-1}$，以最大化财产面积。如果有多个方案能最大化面积，返回任意一个即可。\n\n为了最大化面积，Bill 应选择点：$B_1 = P_0$, $B_3 = P_2$, $B_5 = P_1$\n\n\n\n"},{"iden":"input","content":"第一行包含一个整数 $n$（$2 \\leq n \\leq 50000$），表示 $2n$ 边形的边数。第二行包含 $n$ 个互不相同的整数 $B_{2k}$（$0 \\leq B_{2k} \\leq n-1, k = 0 \\dots n-1$），用单个空格分隔，表示法院选择的点。如果 $B_{2k} = i$，则法院在边 $A_{2k} A_{2k+1}$ 上选择了点 $P_i$。"},{"iden":"output","content":"输出包含 $n$ 个互不相同的整数，用单个空格分隔，表示 Bill 应选择的点 $B_1, B_3, \\dots, B_{2n-1}$，以最大化财产面积。如果有多个方案能最大化面积，返回任意一个即可。"},{"iden":"note","content":"为了最大化面积，Bill 应选择点：$B_1 = P_0$, $B_3 = P_2$, $B_5 = P_1$"}],"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n \\in \\mathbb{Z} $, $ 2 \\leq n \\leq 50000 $.  \nLet $ P = \\{P_0, P_1, \\dots, P_{n-1}\\} $ be the set of points on the even-indexed sides of a regular $ 2n $-gon with side length 1, where $ P_i $ lies on side $ A_{2i}A_{2i+1} $.  \nGiven: A set $ B_{\\text{even}} = \\{B_{2k} \\mid k = 0, \\dots, n-1\\} \\subseteq \\{0, 1, \\dots, n-1\\} $, representing the chosen positions on even-indexed sides.  \n\n**Constraints**  \n- All $ B_{2k} $ are distinct integers in $ \\{0, 1, \\dots, n-1\\} $.  \n\n**Objective**  \nChoose distinct positions $ B_{2k+1} \\in \\{0, 1, \\dots, n-1\\} \\setminus B_{\\text{even}} $ for $ k = 0, \\dots, n-1 $, such that the area of the polygon formed by vertices $ A_0, B_1, A_2, B_3, \\dots, A_{2n-2}, B_{2n-1} $ is maximized.  \n\n**Output**  \nA permutation $ (B_1, B_3, \\dots, B_{2n-1}) $ of the complement of $ B_{\\text{even}} $ in $ \\{0, 1, \\dots, n-1\\} $ that maximizes the area.","simple_statement":null,"has_page_source":false}