#include <bits/stdc++.h>
using namespace std;
pair<int, int> B[25];
int V[25];
int N;
int main() {
  cin >> N;
  for (int i = 1; i <= N; i++) {
    cin >> B[i].first;
    B[i].second = i;
  }
  sort(B + 1, B + 1 + N);
  for (int i = 1; i <= N; i++) V[B[i].second] = B[i % N + 1].first;
  for (int i = 1; i <= N; i++) cout << V[i] << " ";
  return 0;
}
