#include <bits/stdc++.h>
using namespace std;
const int maxn = 25;
const int maxm = 110;
const int mod = 1e9 + 7;
int N, res[maxn];
vector<pair<int, int> > v;
int main() {
  cin >> N;
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    v.push_back(pair<int, int>(a, i));
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < N; i++) res[v[i].second] = v[(i + 1) % N].first;
  for (int i = 0; i < N; i++) cout << res[i] << " ";
  cout << '\n';
  return 0;
}
