#include <bits/stdc++.h>
using namespace std;
int n, s[50], a[50], b[50];
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  cin >> n;
  for (int i = 1; i <= (n); i++) cin >> s[i], b[i] = s[i];
  sort(b + 1, b + 1 + n);
  for (int i = 1; i <= (n); i++) {
    int pos = lower_bound(b + 1, b + 1 + n, s[i]) - b - 1;
    if (!pos) pos = n;
    a[i] = b[pos];
  }
  for (int i = 1; i <= (n); i++) cout << a[i] << ' ';
  cout << endl;
  return 0;
}
