#include <bits/stdc++.h>
using namespace std;
const int N = 2e3 + 10;
const long double eps = 0.2, eps2 = 0.0001;
const int INF = (int)1e9 + 2;
const long long LINF = 1e16;
const double PI = acos(-1.0);
int n;
int a[N], d[N];
int ns[N];
map<int, int> m;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    ns[i] = a[i];
  }
  sort(ns, ns + n);
  for (int i = 0; i < n; i++) {
    m[ns[i]] = i;
  }
  for (int i = 0; i < n; i++) {
    d[i] = (m[a[i]] + 1) % n;
  }
  for (int i = 0; i < n; i++) {
    d[i] = ns[d[i]];
  }
  for (int i = 0; i < n; i++) {
    cout << d[i] << " ";
  }
  return 0;
}
