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