#include <bits/stdc++.h>
using namespace std;
const long long INF = LLONG_MAX / 2;
const long long mod = 1000 * 1000 * 1000 + 7;
const int inf = INT_MAX / 2;
const int N = 100002;
const double Pi = acos((-1));
const double EPS = 1.0 / (99999.9 * (double)inf);
const string io = "1";
int n, a[N], i, j, ans, b[N];
map<int, int> mp;
void solve() {
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    mp[a[i]] = i;
  }
  sort(a + 1, a + n + 1);
  for (i = 1; i <= n; i++) {
    if (i == 1)
      b[mp[a[n]]] = a[1];
    else
      b[mp[a[i - 1]]] = a[i];
  }
  for (i = 1; i <= n; i++) cout << b[i] << " ";
}
int main() {
  int T = 1;
  while (T--) solve();
  return 0;
}
