#include <bits/stdc++.h>
using namespace std;
const int maxn = 25;
int n, res[maxn], a[maxn], b[maxn];
map<int, int> indv;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    indv[a[i]] = i;
  }
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    res[indv[a[(i + 1) % n]]] = a[i];
  }
  for (int i = 0; i < n; i++) {
    cout << res[i] << " ";
  }
  return 0;
}
