#include <bits/stdc++.h>
using namespace std;
int get() {
  char ch;
  while (ch = getchar(), (ch < '0' || ch > '9') && ch != '-')
    ;
  if (ch == '-') {
    int s = 0;
    while (ch = getchar(), ch >= '0' && ch <= '9') s = s * 10 + ch - '0';
    return -s;
  }
  int s = ch - '0';
  while (ch = getchar(), ch >= '0' && ch <= '9') s = s * 10 + ch - '0';
  return s;
}
const int N = 25;
int n;
int a[N], num[N], rk[N];
bool cmp(int x, int y) { return a[x] < a[y]; }
int main() {
  n = get();
  for (int i = 1; i <= n; i++) a[num[i] = i] = get();
  sort(num + 1, num + 1 + n, cmp);
  for (int i = 1; i <= n; i++) rk[num[i]] = i;
  for (int i = 1; i <= n; i++) {
    int x = rk[i] - 1;
    if (!x) x = n;
    printf("%d ", a[num[x]]);
  }
  return 0;
}
