#include <bits/stdc++.h>
using namespace std;
const int N = 50;
int n, ans[N];
pair<int, int> p[N];
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    p[i] = {a, i};
  }
  sort(p, p + n);
  for (int i = 0; i < n; i++) ans[p[i].second] = p[(i - 1 + n) % n].first;
  for (int i = 0; i < n; i++) cout << ans[i] << " ";
  return 0;
}
