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.

Bill’s property can be observed as a convex regular 2n-sided polygon A0 A1... A2n - 1 A2n, A2n = A0, with sides of the exactly 1 meter in length. 

Court rules for removing part of his property are as follows:

  * Split every edge Ak Ak + 1, k = 0... 2n - 1 in n equal parts of size 1 / n with points P0, P1, ..., Pn - 1
  * On every edge A2k A2k + 1, k = 0... n - 1 court will choose one point B2k = Pi for some i = 0, ..., n - 1 such that <image>
  * On every edge A2k + 1A2k + 2, k = 0...n - 1 Bill will choose one point B2k + 1 = Pi for some i = 0, ..., n - 1 such that <image>
  * Bill gets to keep property inside of 2n-sided polygon B0 B1... B2n - 1



Luckily, Bill found out which B2k 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.

Input

The first line contains one integer number n (2 ≤ n ≤ 50000), representing number of edges of 2n-sided polygon.

The second line contains n distinct integer numbers B2k (0 ≤ B2k ≤ n - 1, k = 0... n - 1) separated by a single space, representing points the court chose. If B2k = i, the court chose point Pi on side A2k A2k + 1.

Output

Output contains n distinct integers separated by a single space representing points B1, B3, ..., B2n - 1 Bill should choose in order to maximize the property area. If there are multiple solutions that maximize the area, return any of them.

Example

Input

3
0 1 2


Output

0 2 1

Note

To maximize area Bill should choose points: B1 = P0, B3 = P2, B5 = P1

<image>
#include <bits/stdc++.h>
using namespace std;
int a[50005], ans[50005], nm[50005];
double b[50005], deg, deg0;
bool cmp(int x, int y) { return b[x] > b[y]; }
double work(int a, int n, int b) {
  double l = n / cos(deg) / 2;
  double A = a + l, B = b + l;
  double C = sqrt(A * A + B * B - 2 * A * B * cos(deg0));
  double degA = acos((B * B + C * C - A * A) / B / C / 2),
         degB = acos((A * A + C * C - B * B) / A / C / 2);
  double h1 = a * sin(degB), h2 = b * sin(degA);
  double h = h1 - h2;
  if (h < 0) h = -h;
  return C * h;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  deg = 3.1415926535 / n;
  deg0 = 3.1415926535 - deg * 2;
  for (int i = 1; i <= n; i++)
    if (i == n)
      b[i] = work(n - a[n], n, a[1]);
    else
      b[i] = work(n - a[i], n, a[i + 1]);
  for (int i = 1; i <= n; i++) nm[i] = i;
  sort(nm + 1, nm + 1 + n, cmp);
  int l = 0, r = n - 1;
  for (int i = 1; i <= n; i++) {
    int x = n - a[nm[i]], y;
    if (nm[i] == n)
      y = a[1];
    else
      y = a[nm[i] + 1];
    if (x < y) {
      ans[nm[i]] = r;
      r--;
    } else {
      ans[nm[i]] = l;
      l++;
    }
  }
  for (int i = 1; i < n; i++) printf("%d ", ans[i]);
  printf("%d\n", ans[n]);
  return 0;
}
