#include <bits/stdc++.h>
using namespace std;
int a[25], b[25], sub[25];
bool cmp(int x, int y) { return a[x] < a[y]; }
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    sub[i] = i;
  }
  sort(sub + 1, sub + n + 1, cmp);
  for (int i = 1; i < n; i++) b[sub[i + 1]] = a[sub[i]];
  b[sub[1]] = a[sub[n]];
  for (int i = 1; i < n; i++) cout << b[i] << " ";
  cout << b[n] << endl;
  return 0;
}
