#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<pair<int, int> > v(n);
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i].first;
    v[i].second = i;
    a[i] = v[i].first;
  }
  sort(v.begin(), v.end());
  vector<int> pos(n);
  for (int i = 0; i < n; i++) {
    pos[v[i].second] = i;
  }
  for (int i = 0; i < n; i++) cout << v[(pos[i] + 1) % n].first << " ";
}
