#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 100;
int n, aa[30], bb[30], cc[30];
bool cmp(int a, int b) { return aa[a] < aa[b]; }
int main() {
  while (scanf("%d", &n) != EOF) {
    for (int i = 0; i < n; i++) scanf("%d", &aa[i]), cc[i] = i;
    sort(cc, cc + n, cmp);
    for (int i = 0; i < n; i++) {
      bb[cc[(i + 1) % n]] = aa[cc[i]];
    }
    printf("%d", bb[0]);
    for (int i = 1; i < n; i++) printf(" %d", bb[i]);
    printf("\n");
  }
}
