#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  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());
  vector<int> b(n);
  for (int i = 0; i < n; i++) {
    int j = (i + 1) % n;
    b[a[i].second] = a[j].first;
  }
  for (int i = 0; i < n; i++) {
    if (i) cout << ' ';
    cout << b[i];
  }
  cout << endl;
}
