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