#include <bits/stdc++.h>
using namespace std;
struct T {
  int num, id;
} a[50];
int cmp1(T x, T y) { return x.num < y.num; }
int cmp2(T x, T y) { return x.id < y.id; }
int n;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].num;
    a[i].id = i;
  }
  sort(a + 1, a + n + 1, cmp1);
  a[0] = a[n];
  for (int i = n; i >= 1; i--) a[i].num = a[i - 1].num;
  sort(a + 1, a + n + 1, cmp2);
  for (int i = 1; i <= n; i++) cout << a[i].num << ' ';
  return 0;
}
