#include <bits/stdc++.h>
using namespace std;
const int N = 30;
int a[N], kk[N];
int b[N];
bool cmp(int x, int y) { return a[x] < a[y]; }
int main() {
  int i, n;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (i = 1; i <= n; i++) kk[i] = i;
  sort(kk + 1, kk + 1 + n, cmp);
  b[kk[1]] = a[kk[n]];
  for (i = 2; i <= n; i++) {
    b[kk[i]] = a[kk[i - 1]];
  }
  for (i = 1; i <= n; i++) printf("%d ", b[i]);
  return 0;
}
