#include <bits/stdc++.h>
using namespace std;
int N, t;
pair<int, int> arr[25];
int ans[25];
int main() {
  scanf("%d", &N);
  for (int(i) = (0); (i) <= (N - 1); ++(i)) {
    scanf("%d", &t);
    arr[i] = {t, i};
  }
  sort(arr, arr + N);
  for (int(i) = (0); (i) <= (N - 2); ++(i))
    ans[arr[i].second] = arr[i + 1].first;
  ans[arr[N - 1].second] = arr[0].first;
  for (int(i) = (0); (i) <= (N - 1); ++(i)) printf("%d ", ans[i]);
  puts("");
  return 0;
}
