#include <bits/stdc++.h>
using namespace std;
const int N = 23;
int n, a[N], t[N], b[N];
bool cmp(int x, int y) { return a[x] < a[y]; }
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  for (int i = 1; i <= n; ++i) t[i] = i;
  sort(t + 1, t + n + 1, cmp);
  for (int i = 1; i <= n; ++i) b[t[i]] = a[t[i % n + 1]];
  for (int i = 1; i <= n; ++i) cout << b[i] << " ";
}
