#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, sum = 0, count = 0, m, flag = 0, ans = 0, k;
  cin >> n;
  vector<pair<int, int> > v;
  for (int i = 0; i < n; i++) {
    long long int x;
    cin >> x;
    v.push_back({x, i});
  }
  vector<long long int> p(n);
  sort(v.begin(), v.end());
  for (int i = 1; i < n; i++) {
    p[v[i].second] = v[i - 1].first;
  }
  p[v[0].second] = v[n - 1].first;
  for (auto i : p) cout << i << " ";
  return 0;
}
