#include <bits/stdc++.h>
using namespace std;
int n;
int a[32];
struct help {
  int element;
  int index;
};
help h[32];
bool cmp(help a, help b) {
  if (a.element < b.element) return true;
  if (a.element > b.element) return false;
  return true;
}
int answer[32];
int main() {
  cin >> n;
  int i;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    h[i].element = a[i];
    h[i].index = i;
  }
  sort(h, h + n, cmp);
  for (i = 0; i < n; i++) {
    int NextIndex = i;
    NextIndex++;
    if (NextIndex == n) NextIndex = false;
    answer[h[NextIndex].index] = h[i].element;
  }
  for (i = 0; i < n; i++) cout << answer[i] << " ";
  cout << endl;
  return 0;
}
