#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int N;
  pair<int, int> a[30];
  cin >> N;
  for (long long int i = 0; i < N; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  long long int b[30];
  sort(a, a + N);
  for (long long int i = 1; i < N; i++) {
    b[a[i].second] = a[i - 1].first;
  }
  b[a[0].second] = a[N - 1].first;
  for (long long int i = 0; i < N; i++) {
    cout << b[i] << " ";
  }
  cout << endl;
  return 0;
}
