#include <bits/stdc++.h>
using namespace std;
map<int, int> mp;
const int N = 24;
int a[N], b[N];
int main() {
  int n;
  scanf("%d", &n);
  int i;
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    b[i] = a[i];
  }
  sort(a + 1, a + n + 1);
  for (i = 1; i <= n; i++) mp[a[i]] = i;
  for (i = 1; i <= n; i++) {
    if (mp[b[i]] == n)
      printf("%d ", a[1]);
    else
      printf("%d ", a[mp[b[i]] + 1]);
  }
  return 0;
}
