#include <bits/stdc++.h>
using namespace std;
int n;
pair<int, int> a[27];
int kol[27];
int ao[27];
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; ++i) {
    kol[a[i].second] = i;
    ao[i] = a[i].first;
  }
  for (int i = 1; i <= n; ++i) {
    int x = kol[i];
    if (x == n)
      cout << ao[1] << ' ';
    else
      cout << ao[x + 1] << ' ';
  }
  cout << endl;
  return 0;
}
