#include <bits/stdc++.h>
using namespace std;
pair<long long, long long> a[25];
int b[25];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a, a + n);
  for (int i = 0; i < n; ++i) b[a[i].second] = i;
  for (int i = 0; i < n; ++i) cout << a[(b[i] + 1) % n].first << " ";
}
