#include <bits/stdc++.h>
using namespace std;
struct data {
  int i, j, k;
} f[25];
bool cmp(data a, data b) { return a.j < b.j; }
bool cmp0(data a, data b) { return a.i < b.i; }
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> f[i].j;
    f[i].i = i;
  }
  sort(f, f + n, cmp);
  for (int i = 1; i < n; ++i) f[i].k = f[i - 1].j;
  f[0].k = f[n - 1].j;
  sort(f, f + n, cmp0);
  for (int i = 0; i < n; ++i) cout << f[i].k << " ";
}
