#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a[100005], b[100005], t, i = 0, j, k, x, y, z, count = 0, p,
                                     flag = 0, ans = 0, sum = 0, l, n, m, max1,
                                     min1, pos, tmp, q;
  t = 1;
  while (t--) {
    scanf("%lld", &n);
    map<long long, long long> M;
    for (i = 0; i < n; i++) {
      scanf("%lld", &a[i]);
      b[i] = a[i];
    }
    sort(b, b + n);
    for (i = 0; i < n - 1; i++) {
      M[b[i]] = b[i + 1];
    }
    M[b[n - 1]] = b[0];
    for (i = 0; i < n; i++) printf("%lld ", M[a[i]]);
  }
  return 0;
}
