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