#include <bits/stdc++.h>
using namespace std;
int n, a[100], b[100];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i], b[i] = a[i];
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    int id = upper_bound(a, a + n, b[i]) - a;
    cout << a[id % n] << " ";
  }
}
