#include <bits/stdc++.h>
using namespace std;
long long a[1200000], b[1200000], n, x, ans;
int main() {
  scanf("%I64d", &n);
  ans = n + 5;
  for (int i = 1; i <= n; i++) {
    scanf("%I64d", &b[i]);
    a[i] = b[i];
  }
  sort(b + 1, b + 1 + n);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++)
      if (a[i] < b[j]) {
        printf("%d ", b[j]);
        break;
      }
    if (a[i] == b[n]) printf("%d ", b[1]);
  }
  printf("\n");
}
