#include <bits/stdc++.h>
using namespace std;
long long n, a[1000005], b[1000005];
map<long long, long long> x;
int main() {
  scanf("%lld", &n);
  for (register long long i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
    b[i] = a[i];
  }
  sort(b + 1, b + n + 1);
  for (register long long i = 1; i <= n; i++) x[b[i]] = b[(i % n) + 1];
  for (register long long i = 1; i <= n; i++) printf("%lld ", x[a[i]]);
  return 0;
}
