#include <bits/stdc++.h>
using namespace std;
const int maxn = 23;
pair<int, int> p[maxn];
int n, ANS[maxn];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> p[i].first;
    p[i].second = i;
  }
  sort(p, p + n);
  for (int i = 0; i < n; i++) {
    ANS[p[(i + 1) % n].second] = p[i].first;
  }
  for (int i = 0; i < n; i++) {
    cout << ANS[i] << " ";
  }
  return 0;
}
