#include <bits/stdc++.h>
using namespace std;
const int nax = 2007;
int n;
pair<int, int> tab[nax];
int wyn[nax];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &tab[i].first);
    tab[i].second = i;
  }
  sort(tab + 1, tab + 1 + n);
  wyn[tab[1].second] = tab[n].first;
  for (int i = 2; i <= n; i++) wyn[tab[i].second] = tab[i - 1].first;
  for (int i = 1; i <= n; i++) printf("%d ", wyn[i]);
  printf("\n");
  return 0;
}
