#include <bits/stdc++.h>
using namespace std;
int original[25];
int sorted[25];
int index_original[25];
int answer[25];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> original[i];
    sorted[i] = original[i];
  }
  sort(sorted, sorted + n);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (original[i] == sorted[j]) {
        index_original[i] = j;
      }
    }
  }
  for (int i = 0; i < n; ++i) {
    answer[i] = sorted[(index_original[i] + 1) % n];
  }
  for (int i = 0; i < n; ++i) {
    if (i != 0) {
      cout << " ";
    }
    cout << answer[i];
  }
  cout << endl;
  return 0;
}
