#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  vector<long long> valores(n);
  for (auto &it : valores) scanf("%lld", &it);
  vector<long long> copia(valores);
  sort(copia.begin(), copia.end());
  for (int i = 0; i < n; i++) {
    auto resp = lower_bound(copia.begin(), copia.end(), valores[i]);
    resp++;
    if (resp == copia.end()) resp = copia.begin();
    cout << *resp << " \n"[i == n - 1];
  }
}
