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