#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const long long INF64 = 1e18;
const long double EPS = 1e-7;
mt19937 myrand(time(NULL));
const int N = 23;
int n;
int a[N], b[N];
bool read() {
  if (scanf("%d", &n) != 1) return 0;
  for (int i = 0; i < (n); i++) scanf("%d", &a[i]);
  return 1;
}
void solve() {
  for (int i = 0; i < (n); i++) b[i] = a[i];
  sort(b, b + n);
  for (int i = 0; i < (n); i++) {
    int pos = lower_bound(b, b + n, a[i]) - b;
    printf("%d ", b[(pos + 1) % n]);
  }
  puts("");
}
int main() {
  while (read()) solve();
  return 0;
}
