#include <bits/stdc++.h>
int n;
int a[30];
using namespace std;
int ind[30];
map<int, int> b;
bool cmp(int i1, int i2) { return a[i1] < a[i2]; }
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    ind[i] = i;
  }
  sort(&ind[0], &ind[n], cmp);
  for (int i = 0; i < n; i++) {
    b[a[ind[i]]] = i;
  }
  for (int i = 0; i < n; i++) {
    int j = (b[a[i]] + 1) % n;
    cout << a[ind[j]] << " ";
  }
  cout << endl;
}
