#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e1 + 5;
map<int, int> mp;
long long n, arr[MAXN], brr[MAXN], crr[MAXN];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    brr[i] = arr[i];
  }
  sort(arr, arr + n);
  for (int i = 0; i < n; i++) {
    crr[i] = arr[(i + 1) % n];
  }
  for (int i = 0; i < n; i++) {
    mp[arr[i]] = crr[i];
  }
  for (int i = 0; i < n; i++) {
    cout << mp[brr[i]] << " ";
  }
  return 0;
}
