#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
int main() {
  ll n;
  cin >> n;
  vector<pair<ll, ll>> v;
  for (ll i = 0; i < n; ++i) {
    ll x;
    cin >> x;
    v.push_back({x, i});
  }
  ll b[n];
  sort(v.begin(), v.end());
  for (ll i = 1; i < n; ++i) {
    b[v[i - 1].second] = v[i].first;
  }
  b[v[n - 1].second] = v[0].first;
  for (ll i = 0; i < n; ++i) cout << b[i] << " ";
  return 0;
}
