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