#include <bits/stdc++.h>
using namespace std;
int a[100], b[100];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    b[i] = a[i];
  }
  sort(b + 1, b + n + 1);
  for (int i = 1; i <= n; i++) {
    int x = 0;
    for (int j = 1; j <= n; j++) {
      if (a[i] == b[j]) x = j;
    }
    x++;
    if (x > n) x = 1;
    cout << b[x] << " ";
  }
  puts("");
}
