#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 10;
signed main() {
  ios::sync_with_stdio(false);
  long long n;
  cin >> n;
  vector<pair<long long, long long>> a(n);
  for (long long i = 0; i < n; i++) cin >> a[i].first, a[i].second = i;
  sort(a.begin(), a.end());
  vector<long long> b(n);
  for (long long i = 0; i < n; i++) b[a[i].second] = i;
  for (long long i = 0; i < n; i++)
    cout << a[(b[i] + 1) % n].first << " \n"[i == n - 1];
  return 0;
}
