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