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