#include <bits/stdc++.h>
using namespace std;
const int maxn = 25;
int n;
int arr[maxn];
int ans[maxn];
pair<int, int> p[maxn];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    p[i] = pair<int, int>(arr[i], i);
  }
  sort(p, p + n);
  for (int i = 0; i < n; i++) {
    if (i != n - 1)
      ans[p[i].second] = p[i + 1].first;
    else
      ans[p[i].second] = p[0].first;
  }
  for (int i = 0; i < n; i++) {
    cout << ans[i] << ' ';
  }
  cout << endl;
  return 0;
}
