#include <bits/stdc++.h>
using namespace std;
int a[29], b[30], c[30];
bool cmp(int x, int y) { return a[x] < a[y]; }
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    b[i] = i;
  }
  sort(b, b + n, cmp);
  for (int i = 0; i < n - 1; i++) {
    c[b[i]] = a[b[i + 1]];
  }
  c[b[n - 1]] = a[b[0]];
  for (int i = 0; i < n; i++) {
    printf("%d ", c[i]);
  }
  printf("\n");
  return 0;
}
