#include <bits/stdc++.h>
using namespace std;
int arr[25], app[25];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", arr + i);
    app[i] = arr[i];
  }
  sort(app, app + n);
  for (int i = 0; i < n; i++)
    printf("%d%c", app[(lower_bound(app, app + n, arr[i]) - app + 1) % n],
           " \n"[i + 1 == n]);
  return 0;
}
