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;
const double eps = 1e-10;
int dcmp(double x) {
  if (fabs(x) < eps) return 0;
  return x < 0 ? -1 : 1;
}
struct Pt {
  double x, y;
  Pt() {}
  Pt(double x, double y) : x(x), y(y) {}
  Pt operator+(const Pt &rhs) const { return Pt(x + rhs.x, y + rhs.y); }
  Pt operator-(const Pt &rhs) const { return Pt(x - rhs.x, y - rhs.y); }
  Pt operator*(double r) const { return Pt(x * r, y * r); }
  Pt operator/(double r) const { return Pt(x / r, y / r); }
  bool operator<(const Pt &rhs) const {
    return x != rhs.x ? x < rhs.x : y < rhs.y;
  }
  bool operator==(const Pt &rhs) const {
    return !dcmp(x - rhs.x) && !dcmp(y - rhs.y);
  }
};
double Dot(const Pt &a, const Pt &b) { return a.x * b.x + a.y * b.y; }
double Len(const Pt &a) { return sqrt(Dot(a, a)); }
double angle(const Pt &a, const Pt &b) {
  return acos(Dot(a, b) / Len(a) / Len(b));
}
double Cross(const Pt &a, const Pt &b) { return a.x * b.y - b.x * a.y; }
double area(const Pt &a, const Pt &b, const Pt &c) {
  return Cross(b - a, c - a);
}
Pt Rot(const Pt &v, double r) {
  return Pt(v.x * cos(r) - v.y * sin(r), v.x * sin(r) + v.y * cos(r));
}
Pt Normal(const Pt &v) {
  double L = Len(v);
  return Pt(-v.y / L, v.x / L);
}
const int N = 50005;
const double pi = acos(-1);
Pt a[N], b[N], O(0, 0);
int n;
int c[N];
bool flag[N];
struct Node {
  double dt;
  int id;
  Node() {}
  Node(double dt, int id) : dt(dt), id(id) {}
  bool operator<(const Node &rhs) const { return dt > rhs.dt; }
} p[N];
int ans[N];
int main() {
  scanf("%d", &n);
  Pt P(n, 0);
  double ang = pi / n;
  for (int i = 0; i < n; i++)
    a[i] = Pt(-(n - i) * cos(ang), (n - i) * sin(ang));
  for (int i = 0; i < n; i++) b[i] = P + Pt(i * cos(ang), i * sin(ang));
  for (int i = 0; i < n; i++) scanf("%d", c + i);
  c[n] = c[0];
  for (int i = 0; i < n; i++)
    p[i].dt = abs(abs(Cross(a[c[i]], b[c[i + 1]])) -
                  abs(Cross(a[c[i]] - Pt(1, 0), b[c[i + 1]] - Pt(1, 0))));
  for (int i = 0; i < n; i++) p[i].id = i;
  int lt = 0, rt = n - 1;
  sort(p, p + n);
  for (int i = 0; i < n; i++) {
    int id = p[i].id;
    if (c[id] + c[id + 1] < n)
      ans[id] = lt++;
    else
      ans[id] = rt--;
  }
  for (int i = 0; i < n; i++) printf("%d ", ans[i]);
  return 0;
}
