#include <bits/stdc++.h>
using namespace std;
pair<int, int> p[30];
int ans[30];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &p[i].first);
    p[i].second = i;
  }
  sort(p, p + n);
  for (int i = 0; i < n; i++) {
    ans[p[i].second] = p[(i + 1) % n].first;
  }
  for (int i = 0; i < n; i++) {
    if (i == n - 1) {
      cout << ans[i] << endl;
    } else {
      cout << ans[i] << " ";
    }
  }
  return 0;
}
