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