#include <bits/stdc++.h>
int a[22], b[22], f[22];
int main(void) {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    f[i] = i;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < i; j++) {
      if (a[f[i]] < a[f[j]]) {
        int t = f[i];
        f[i] = f[j];
        f[j] = t;
      }
    }
  }
  for (int i = 0; i < n; i++) b[f[i]] = a[f[(i + 1) % n]];
  for (int i = 0; i < n; i++) printf("%d ", b[i]);
  return 0;
}
