#include <bits/stdc++.h>
using namespace std;
const int inf = 1e8;
const int maxn = 1e5 + 100;
const int mod = 1e9 + 7;
int a[maxn], b[maxn];
int rk[maxn];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> a[i], b[i] = a[i];
  sort(b, b + n);
  int m = unique(b, b + n) - b;
  if (m < n) {
    cout << -1;
    return 0;
  }
  for (int i = 0; i < n; ++i) rk[i] = lower_bound(b, b + n, a[i]) - b;
  for (int i = 0; i < n; ++i) cout << b[(rk[i] + 1) % n] << " ";
  return 0;
}
