#include <bits/stdc++.h>
using namespace std;
const int maxn = 100050;
int a[maxn], b[maxn];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  while (cin >> n) {
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      b[i] = a[i];
    }
    sort(b, b + n);
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (a[i] == b[j]) {
          if (j == n - 1) {
            cout << b[0] << " ";
          } else {
            cout << b[j + 1] << " ";
          }
        }
      }
    }
    cout << endl;
  }
  return 0;
}
