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 int MOD = (int)1e9 + 7;
const int FFTMOD = 1007681537;
const int INF = (int)1e9;
const long long LINF = (long long)1e18;
const long double PI = acos((long double)-1);
const long double EPS = 1e-9;
inline long long gcd(long long a, long long b) {
  long long r;
  while (b) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
inline long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
inline long long fpow(long long n, long long k, int p = MOD) {
  long long r = 1;
  for (; k; k >>= 1) {
    if (k & 1) r = r * n % p;
    n = n * n % p;
  }
  return r;
}
template <class T>
inline int chkmin(T& a, const T& val) {
  return val < a ? a = val, 1 : 0;
}
template <class T>
inline int chkmax(T& a, const T& val) {
  return a < val ? a = val, 1 : 0;
}
inline long long isqrt(long long k) {
  long long r = sqrt(k) + 1;
  while (r * r > k) r--;
  return r;
}
inline long long icbrt(long long k) {
  long long r = cbrt(k) + 1;
  while (r * r * r > k) r--;
  return r;
}
inline void addmod(int& a, int val, int p = MOD) {
  if ((a = (a + val)) >= p) a -= p;
}
inline void submod(int& a, int val, int p = MOD) {
  if ((a = (a - val)) < 0) a += p;
}
inline int mult(int a, int b, int p = MOD) { return (long long)a * b % p; }
inline int inv(int a, int p = MOD) { return fpow(a, p - 2, p); }
inline int sign(long double x) { return x < -EPS ? -1 : x > +EPS; }
inline int sign(long double x, long double y) { return sign(x - y); }
struct PT {
  long double x, y;
  PT(long double x = 0, long double y = 0) : x(x), y(y) {}
  PT operator+(const PT& rhs) { return PT(x + rhs.x, y + rhs.y); }
  PT operator-(const PT& rhs) { return PT(x - rhs.x, y - rhs.y); }
  PT operator*(const long double& k) { return PT(x * k, y * k); }
};
long double cross(PT a, PT b) { return a.x * b.y - a.y * b.x; }
long double area(PT a, PT b, PT c) {
  return abs(cross(a, b) + cross(b, c) + cross(c, a));
}
const int maxn = 5e4 + 4;
int n;
int x[maxn];
PT p[maxn + maxn];
long double f[maxn];
int cmp(int i, int j) {
  if (f[i] != f[j]) return f[i] > f[j];
  return i > j;
}
void solve() {
  cin >> n;
  for (int i = (0); i < (n); i++) cin >> x[i];
  for (int i = (0); i < (n + n); i++) {
    p[i] = PT(cos(PI * i / n), sin(PI * i / n));
  }
  vector<int> ver;
  for (int i = (0); i < (n); i++) {
    int j = (i + 1) % n;
    PT a = p[i + i] + (p[i + i + 1] - p[i + i]) * ((long double)x[i] / n);
    PT b = p[j + j] + (p[j + j + 1] - p[j + j]) * ((long double)x[j] / n);
    f[i] = area(a, b, p[i + i + 1]) - area(a, b, p[j + j]);
    ver.push_back(i);
  }
  sort((ver).begin(), (ver).end(), cmp);
  static int ans[maxn];
  for (int i = (0); i < (n); i++) ans[ver[i]] = i;
  for (int i = (0); i < (n); i++) cout << ans[i] << " \n"[i == n - 1];
}
int main(int argc, char* argv[]) {
  ios_base::sync_with_stdio(0), cin.tie(0);
  int JUDGE_ONLINE = 1;
  if (argc > 1) {
    JUDGE_ONLINE = 0;
    assert(freopen(argv[1], "r", stdin));
  }
  if (argc > 2) {
    JUDGE_ONLINE = 0;
    assert(freopen(argv[2], "w", stdout));
  }
  solve();
  if (!JUDGE_ONLINE) {
    cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
  }
  return 0;
}
