#include <bits/stdc++.h>
using namespace std;
const int MAXN = 25;
int n, a[MAXN], b[MAXN], t[MAXN];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]), t[i] = a[i];
  sort(t, t + n);
  for (int i = 0; i < n; i++) {
    int j = 0;
    while (a[i] >= t[j] && j < n) j++;
    if (j == n)
      b[i] = t[0];
    else
      b[i] = t[j];
  }
  for (int i = 0; i < n; i++) {
    if (i) printf(" ");
    printf("%d", b[i]);
  }
  printf("\n");
}
