#include <bits/stdc++.h>
using namespace std;
const long long maxn = 2e5 + 15, inf = 2e9, lg = 26, mo = 998244353;
int main() {
  int n;
  cin >> n;
  pair<int, int> p[n];
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    p[i] = {a[i], i};
  }
  sort(p, p + n);
  for (int i = 0; i < n; i++) {
    a[p[(i + 1) % n].second] = p[i].first;
  }
  for (int i = 0; i < n; i++) cout << a[i] << " ";
  return 0;
}
