#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  pair<long long, long long> a[n + 10];
  long long ans[n + 10];
  for (long long i = 0; i < n; i++) {
    long long x;
    cin >> x;
    a[i] = make_pair(x, i);
  }
  sort(a, a + n);
  for (long long i = 0; i < n; i++) ans[a[i].second] = a[(i - 1 + n) % n].first;
  for (long long i = 0; i < n; i++) cout << ans[i] << " ";
}
