#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const double eps = 1e-6;
const int MAXN = 2e3 + 10;
const int MAXM = 2e6 + 10;
const long long mod = 1e9 + 7;
int a[25], b[25], c[25];
bool cmp(int x, int y) { return a[x] < a[y]; }
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    b[i] = i;
  }
  sort(b, b + n, cmp);
  for (int i = 0; i < n - 1; i++) c[b[i]] = a[b[i + 1]];
  c[b[n - 1]] = a[b[0]];
  for (int i = 0; i < n; i++) printf("%d ", c[i]);
  return 0;
}
