#include <bits/stdc++.h>
using namespace std;
int n, ans[25];
pair<int, int> a[25];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  if (n == 1) {
    cout << a[1].first;
    return 0;
  }
  sort(a + 1, a + n + 1);
  for (int i = 2; i <= n; i++) {
    ans[a[i - 1].second] = a[i].first;
  }
  ans[a[n].second] = a[1].first;
  for (int i = 1; i <= n; i++) {
    cout << ans[i] << " ";
  }
}
