#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int T[n], P[n];
  for (int i = 0; i < n; ++i) {
    cin >> T[i];
    P[i] = T[i];
  }
  sort(P, P + n);
  map<int, int> M;
  for (int i = 0; i < n; ++i) M[P[i]] = P[(i + 1) % n];
  for (int i = 0; i < n; ++i) cout << M[T[i]] << " ";
  cout << endl;
}
