#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  vector<pair<long long, long long>> a(n);
  vector<long long> ord(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a.begin(), a.end());
  for (long long i = 0; i < n; i++) {
    ord[a[i].second] = i;
  }
  for (long long i = 0; i < n; i++) {
    cout << (a[(ord[i] + 1) % n].first) << " ";
  }
  return 0;
}
