#include <bits/stdc++.h>
using namespace std;
int n, a[25], b[25];
map<int, int> P;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]), b[i] = a[i];
  sort(a, a + n);
  for (int i = 0; i < n; i++) P[a[i]] = (i + 1) % n;
  for (int i = 0; i < n; i++) printf("%d ", a[P[b[i]]]);
}
