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 pct(int x) { return __builtin_popcount(x); }
int pct(long long x) { return __builtin_popcountll(x); }
int bit(int x) { return 31 - __builtin_clz(x); }
int bit(long long x) { return 63 - __builtin_clzll(x); }
int cdiv(int a, int b) { return a / b + !(a < 0 || a % b == 0); }
long long cdiv(long long a, long long b) {
  return a / b + !(a < 0 || a % b == 0);
}
int nxt_C(int x) {
  int c = x & -x, r = x + c;
  return (((r ^ x) >> 2) / c) | r;
}
long long nxt_C(long long x) {
  long long c = x & -x, r = x + c;
  return (((r ^ x) >> 2) / c) | r;
}
vector<int> get_bits(int mask) {
  vector<int> bb;
  while (mask) {
    int b = bit(mask);
    bb.push_back(b);
    mask ^= (1 << b);
  }
  reverse(bb.begin(), bb.end());
  return bb;
}
int get_mask(vector<int> v) {
  int mask = 0;
  for (int x : v) {
    mask ^= (1 << x);
  }
  return mask;
}
template <typename T>
void uniq(vector<T> &v) {
  sort(v.begin(), v.end());
  v.resize(unique(v.begin(), v.end()) - v.begin());
}
template <typename T>
void leftShift(vector<T> &v, long long k) {
  k %= (int)v.size();
  if (k < 0) k += (int)v.size();
  rotate(v.begin(), v.begin() + k, v.end());
}
template <typename T>
void rightShift(vector<T> &v, long long k) {
  leftShift(v, (int)v.size() - k);
}
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
long long rand(long long l, long long r) {
  uniform_int_distribution<long long> uid(l, r);
  return uid(rng);
}
void pr() {}
void sc() {}
template <typename Head, typename... Tail>
void pr(Head H, Tail... T) {
  cout << H << " ";
  pr(T...);
}
template <typename Head, typename... Tail>
void sc(Head &H, Tail &...T) {
  cin >> H;
  sc(T...);
}
string to_string(__int128 x) {
  string s = "";
  bool neg = 0;
  if (x < 0) {
    s += "-";
    neg = 1;
    x = -x;
  }
  if (!x) s += '0';
  while (x) {
    int rem = x % 10;
    s += to_string(rem);
    x /= 10;
  }
  reverse(s.begin() + neg, s.end());
  return s;
}
const int mod = 1e9 + 7;
int pwr(int a, int b) {
  int ans = 1;
  while (b) {
    if (b & 1) ans = (ans * 1LL * a) % mod;
    a = (a * 1LL * a) % mod;
    b >>= 1;
  }
  return ans;
}
const int N = 50005;
int b[N];
vector<pair<int, int> > v, v1;
int ans[N];
void solve() {
  int n;
  sc(n);
  for (int i = 0; i <= n - 1; i++) {
    sc(b[i]);
  }
  for (int i = 0; i <= n - 1; i++) {
    int s1 = n - b[i], s2 = b[(i + 1) % n];
    if (s1 > s2)
      v.push_back({s1 - s2, i});
    else
      v1.push_back({s2 - s1, i});
  }
  sort(v.begin(), v.end());
  sort(v1.begin(), v1.end());
  reverse(v.begin(), v.end());
  int c = 0;
  for (int i = 0; i <= (int)v.size() - 1; i++) {
    ans[v[i].second] = c++;
  }
  for (int i = 0; i <= (int)v1.size() - 1; i++) {
    ans[v1[i].second] = c++;
  }
  for (int i = 0; i <= n - 1; i++) {
    cout << ans[i] << " ";
  }
}
signed main() {
  ios ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  for (int tt = 1; tt <= t; tt++) {
    solve();
  }
  return 0;
}
