#include <bits/stdc++.h>
using namespace std;
int gcd(int x, int y) {
  int t;
  while (y != 0) {
    t = x % y;
    x = y;
    y = t;
  }
  return x;
}
int a[100005], b[100005];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &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]) cout << b[(j + 1) % n] << ' ';
  }
  cout << endl;
  return 0;
}
