#include <bits/stdc++.h>
using namespace std;
FILE *in, *out;
int N, M, K;
pair<int, int> ar[100];
int read() {
  int i, j, k;
  int x, y;
  cin >> N;
  for (i = 0; i < N; i++) {
    cin >> ar[i].first;
    ar[i].second = i;
  }
  sort(ar, ar + N);
  j = ar[0].second;
  for (i = 0; i < N - 1; i++) {
    ar[i].second = ar[i + 1].second;
  }
  ar[N - 1].second = j;
  for (i = 0; i < N; i++) swap(ar[i].first, ar[i].second);
  sort(ar, ar + N);
  for (i = 0; i < N; i++) {
    cout << ar[i].second << " ";
  }
  cout << "\n";
  return 0;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  in = stdin;
  out = stdout;
  read();
  return 0;
}
