#include <bits/stdc++.h>
using namespace std;
const int N = 5e3 + 5, inf = 0x3f3f3f3f;
int n, a[N], v[N], b[N];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i], v[i] = a[i];
  sort(v, v + n);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (a[i] == v[j]) {
        b[i] = v[(j + 1) % n];
        break;
      }
    }
  }
  for (int i = 0; i < n; i++) printf("%d ", b[i]);
  return 0;
}
