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;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
const double EPS = 1e-9;
const double PI = acos(-1);
bool eq(double a, double b) { return fabs(a - b) < EPS; }
pair<double, double> sub(pair<double, double> a, pair<double, double> b) {
  return {a.first - b.first, a.second - b.second};
}
pair<double, double> add(pair<double, double> a, pair<double, double> b) {
  return {a.first + b.first, a.second + b.second};
}
const int N = int(1e5) + 10;
pair<double, double> A[3][N];
int B[N], first[N], arr[N], ans[N];
double val[N];
double dist(pair<double, double> x, pair<double, double> y) {
  return hypot({x.first - y.first}, {x.second - y.second});
}
double cross(pair<double, double> a, pair<double, double> b) {
  return fabs(a.first * b.second - a.second * b.first);
}
double perp(pair<double, double> a, pair<double, double> b,
            pair<double, double> x) {
  pair<double, double> ab = sub(b, a);
  pair<double, double> ax = sub(x, a);
  return cross(ab, ax);
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = (0); i < (n); ++i) scanf("%d", &B[i]);
  for (int i = (0); i < (n); ++i) A[1][i] = {i, 0};
  double theta = PI / n;
  pair<double, double> v1 = {cos(theta), sin(theta)};
  A[2][0] = {n, 0};
  for (int i = (1); i < (n); ++i) {
    A[2][i] = add(A[2][i - 1], v1);
  }
  v1 = {cos(PI - theta), sin(PI - theta)};
  A[0][n - 1] = add(A[1][0], v1);
  for (int i = n - 2; i >= 0; i--) A[0][i] = add(A[0][i + 1], v1);
  for (int i = (0); i < (n - 1); ++i) {
    if (n - B[i] > B[i + 1]) {
      first[i] = -1;
    } else if (n - B[i] < B[i + 1]) {
      first[i] = +1;
    } else {
      first[i] = 0;
    }
  }
  for (int i = (0); i < (n); ++i) {
    int x = B[i], y = B[(i + 1) % n];
    val[i] = perp(A[0][x], A[2][y], A[1][0]) - perp(A[0][x], A[2][y], A[1][1]);
  }
  for (int i = (0); i < (n); ++i) {
    arr[i] = i;
  }
  sort(arr, arr + n, [](int a, int b) { return val[a] > val[b]; });
  for (int i = (0); i < (n); ++i) {
    ans[arr[i]] = i;
  }
  for (int i = (0); i < (n); ++i) printf("%d ", ans[i]);
  puts("");
  return 0;
}
