#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans[1000000];
  pair<int, int> a[100000];
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i].first);
    a[i].second = i;
  }
  sort(a, a + n);
  ans[a[0].second] = a[n - 1].first;
  for (int i = 1; i < n; i++) ans[a[i].second] = a[i - 1].first;
  printf("%d", ans[0]);
  for (int i = 1; i < n; i++) printf(" %d", ans[i]);
  printf("\n");
}
