#include <bits/stdc++.h>
using namespace std;
int n;
int a[30], a2[30];
int b[30];
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    b[i] = a2[i] = a[i];
  }
  sort(a2, a2 + n);
  for (int i = 0; i < n; i++) {
    int j1 = 0;
    while (a2[j1] != b[i]) j1++;
    b[i] = a2[(j1 + 1) % n];
  }
  for (int i = 0; i < n; i++) cout << b[i] << " ";
}
