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 <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c* x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  template <class c>
  debug& operator<<(const c&) {
    return *this;
  }
};
using ll = long long;
using ld = long double;
constexpr int nax = 50 * 1000 + 105;
constexpr int infty = 1000 * 1000 * 1000 + 5;
constexpr int mod = 1000 * 1000 * 1000 + 7;
struct Punkt {
  ld x, y;
  explicit Punkt(ld kat) {
    x = cos(kat);
    y = sin(kat);
    debug() << " ["
            << "kat"
               ": "
            << (kat)
            << "] "
               " ["
            << "sin(kat)"
               ": "
            << (sin(kat)) << "] ";
  }
  Punkt& operator+=(const Punkt& a) {
    x += a.x;
    y += a.y;
    return *this;
  }
  Punkt& operator-=(const Punkt& a) {
    x -= a.x;
    y -= a.y;
    return *this;
  }
  Punkt& operator*=(ld v) {
    x *= v;
    y *= v;
    return *this;
  }
  Punkt& operator/=(ld v) {
    x /= v;
    y /= v;
    return *this;
  }
  Punkt operator+(const Punkt& a) const { return Punkt(*this) += a; }
  Punkt operator-(const Punkt& a) const { return Punkt(*this) -= a; }
  Punkt operator*(ld v) const { return Punkt(*this) *= v; }
  Punkt operator/(ld v) const { return Punkt(*this) /= v; }
  ld operator%(const Punkt& a) const { return x * a.y - y * a.x; }
};
debug& operator<<(debug& deb, const Punkt& p) {
  return deb << "(" << p.x << ", " << p.y << ")";
}
int n;
int perm[nax];
ld Wspolczynnik(int aa, int bb) {
  Punkt A(-((3.141592653589793238462643383279l)) / n);
  Punkt B(0);
  Punkt C(((3.141592653589793238462643383279l)) / n);
  Punkt D((2 * (3.141592653589793238462643383279l)) / n);
  Punkt E = (A * (n - aa) + B * aa) / n;
  Punkt F = (C * (n - bb) + D * bb) / n;
  Punkt Ga = (C - B) / n;
  Punkt Gb = B;
  Punkt v1 = F - E;
  Punkt v2_a = Ga;
  Punkt v2_b = Gb - E;
  debug() << " ["
          << "A"
             ": "
          << (A)
          << "] "
             " ["
          << "B"
             ": "
          << (B)
          << "] "
             " ["
          << "C"
             ": "
          << (C)
          << "] "
             " ["
          << "D"
             ": "
          << (D)
          << "] "
             " ["
          << "E"
             ": "
          << (E)
          << "] "
             " ["
          << "F"
             ": "
          << (F)
          << "] "
             " ["
          << "Ga"
             ": "
          << (Ga)
          << "] "
             " ["
          << "Gb"
             ": "
          << (Gb)
          << "] "
             " ["
          << "v1"
             ": "
          << (v1)
          << "] "
             " ["
          << "v2_a"
             ": "
          << (v2_a)
          << "] "
             " ["
          << "v2_b"
             ": "
          << (v2_b) << "] ";
  ld pole_a = (v2_a % v1) / 2;
  ld pole_b = (v2_b % v1) / 2;
  if (pole_b < 0) {
    debug() << "WARNINGNOGNONGONOGNOG";
    pole_a *= -1;
    pole_b *= -1;
  }
  debug() << " ["
          << "aa"
             ": "
          << (aa)
          << "] "
             " ["
          << "bb"
             ": "
          << (bb)
          << "] "
             " ["
          << "pole_a"
             ": "
          << (pole_a)
          << "] "
             " ["
          << "pole_b"
             ": "
          << (pole_b) << "] ";
  return pole_a;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &perm[i]);
  perm[n] = perm[0];
  vector<pair<ld, int>> wspolczynniki;
  for (int i = 0; i < n; i++) {
    wspolczynniki.emplace_back(Wspolczynnik(perm[i], perm[i + 1]), i);
  }
  sort(wspolczynniki.begin(), wspolczynniki.end());
  debug() << " ["
          << "wspolczynniki"
             ": "
          << (wspolczynniki) << "] ";
  for (int i = 0; i < n; i++) {
    perm[wspolczynniki[i].second] = i;
  }
  for (int i = 0; i < n; i++) {
    printf("%d ", perm[i]);
  }
  printf("\n");
  return 0;
}
