#include <bits/stdc++.h>
using namespace std;
pair<int, int> v[50];
int rez[50];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &v[i].first);
    v[i].second = i;
  }
  sort(v + 1, v + n + 1);
  for (int i = 1; i < n; i++) rez[v[i].second] = v[i + 1].first;
  rez[v[n].second] = v[1].first;
  for (int i = 1; i <= n; i++) printf("%d ", rez[i]);
  return 0;
}
