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;
struct PT {
  double first, second;
  PT() : first(0), second(0) {}
  PT(double first, double second) : first(first), second(second) {}
  PT(const PT& p) : first(p.first), second(p.second) {}
  int operator<(const PT& rhs) const {
    return make_pair(second, first) < make_pair(rhs.second, rhs.first);
  }
  int operator==(const PT& rhs) const {
    return make_pair(second, first) == make_pair(rhs.second, rhs.first);
  }
  PT operator+(const PT& p) const {
    return PT(first + p.first, second + p.second);
  }
  PT operator-(const PT& p) const {
    return PT(first - p.first, second - p.second);
  }
  PT operator*(double c) const { return PT(first * c, second * c); }
  PT operator/(double c) const { return PT(first / c, second / c); }
};
double cross(PT p, PT q) { return p.first * q.second - p.second * q.first; }
double area(PT a, PT b, PT c) {
  return fabs(cross(a, b) + cross(b, c) + cross(c, a)) / 2;
}
double area2(PT a, PT b, PT c) {
  return cross(a, b) + cross(b, c) + cross(c, a);
}
double dot(PT p, PT q) { return p.first * q.first + p.second * q.second; }
double dist(PT p, PT q) { return sqrt(dot(p - q, p - q)); }
double dist2(PT p, PT q) { return dot(p - q, p - q); }
PT RotateCCW90(PT p) { return PT(-p.second, p.first); }
PT RotateCW90(PT p) { return PT(p.second, -p.first); }
PT RotateCCW(PT p, double t) {
  return PT(p.first * cos(t) - p.second * sin(t),
            p.first * sin(t) + p.second * cos(t));
}
int sign(double first) { return first < -1e-9 ? -1 : first > 1e-9; }
int sign(double first, double second) { return sign(first - second); }
ostream& operator<<(ostream& os, const PT& p) {
  os << "(" << p.first << "," << p.second << ")";
  return os;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<int> b(n);
  for (int i = 0; i < n; i++) {
    cin >> b[i];
  }
  vector<double> hdiff;
  double r = 1000;
  for (int i = 0; i < n; i++) {
    int i1 = i, i2 = (i + 1) % n;
    vector<PT> points(4);
    for (int j = 0; j < 4; j++) {
      double ang = 2 * j * (acosl(0)) / (n);
      points[j] = PT(r * cosl(ang), r * sinl(ang));
    }
    PT lef = (points[0] * b[i1] + points[1] * (n - b[i1])) / n;
    PT rig = (points[2] * b[i2] + points[3] * (n - b[i2])) / n;
    PT p1 = points[1], p2 = (points[1] * (n - 1) + points[2]) / n;
    hdiff.push_back(area(lef, rig, p1) - area(lef, rig, p2));
  }
  vector<int> P(n);
  for (int i = 0; i < n; i++) {
    P[i] = i;
  }
  sort((P).begin(), (P).end(),
       [&](int i, int j) { return hdiff[i] < hdiff[j]; });
  vector<int> ans(n);
  for (int i = 0; i < n; i++) {
    ans[P[i]] = i;
  }
  for (int i = 0; i < n; i++) {
    cout << ans[i] << ' ';
  }
  return 0;
}
