#include <bits/stdc++.h>
using namespace std;
const int N = 30;
int n, a[N], b[N], c[N];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i], c[i] = a[i];
  sort(c, c + n);
  for (int i = 0; i < n; i++)
    b[i] = c[((lower_bound(c, c + n, a[i]) - c) + 1) % n];
  for (int i = 0; i < n; i++) printf("%d%c", b[i], i == (n - 1) ? '\n' : ' ');
  return 0;
}
