#include <bits/stdc++.h>
using namespace std;
int main() {
  pair<int, int> a[30];
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a + 1, a + n + 1);
  a[0] = a[n];
  for (int i = n; i > 0; i--) a[i].second = a[i - 1].second;
  int ans[40];
  for (int i = 1; i <= n; i++) {
    ans[a[i].second] = a[i].first;
  }
  for (int i = 1; i <= n; i++) cout << ans[i] << ' ';
}
