#include <bits/stdc++.h>
using namespace std;
const int N = 23;
int n;
int a[N], v[N];
int p[N], q[N];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    p[i] = i;
  }
  sort(p, p + n, [](int i, int j) { return a[i] < a[j]; });
  for (int i = 0; i < n; i++) {
    q[p[i]] = i;
  }
  for (int i = 0; i < n; i++) {
    if (q[i] != n - 1)
      v[i] = a[p[q[i] + 1]];
    else
      v[i] = a[p[0]];
  }
  for (int i = 0; i < n; i++) printf("%d ", v[i]);
  printf("\n");
}
