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