#include <bits/stdc++.h>
using namespace std;
vector<pair<long long, long long> > a;
pair<long long, long long> x;
long long b[30], n;
signed main() {
  ios_base ::sync_with_stdio(0);
  cin.tie();
  cout.tie();
  cin >> n;
  a.push_back(x);
  for (long long i = 1; i <= n; i++) {
    cin >> x.first;
    x.second = i;
    a.push_back(x);
  }
  sort(a.begin(), a.end());
  for (long long i = 1; i <= n; i++) {
    b[a[i].second] = a[i - 1].first;
  }
  b[a[1].second] = a[n].first;
  for (long long i = 1; i <= n; i++) cout << b[i] << " ";
}
