#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
constexpr int MOD = 1e9 + 7;
constexpr int MAXN = 1e6 + 8;
int N, M, K, Q;
pair<int, int> a[2002];
int ans[2002];
void preprocess() {}
void solution() {
  sort(a, a + N);
  for (int i = 0; i < N; ++i) {
    ans[a[(i + 1) % N].second] = a[i].first;
  }
  for (int i = 0; i < N; ++i) {
    printf("%d ", ans[i]);
  }
}
int main() {
  scanf("%d", &N);
  for (int i = 0; i < N; ++i) {
    scanf("%d", &a[i].first);
    a[i].second = i;
  }
  solution();
  return 0;
}
