#include <bits/stdc++.h>
using namespace std;
const long long inf = 1LL << 61;
const long long mod = 1000000007;
const int maxn = 25;
int arr[maxn], ans[maxn];
int main() {
  std::ios::sync_with_stdio(false);
  int n;
  pair<int, int> b[maxn];
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &arr[i]);
    b[i].first = arr[i];
    b[i].second = i;
  }
  sort(b + 1, b + n + 1);
  ans[b[n].second] = b[1].first;
  for (int i = 1; i < n; i++) {
    ans[b[i].second] = b[i + 1].first;
  }
  for (int i = 1; i <= n; i++) {
    printf("%d ", ans[i]);
  }
  return 0;
}
