#include <bits/stdc++.h>
using namespace std;
const int Mod = 1e9 + 9;
struct node {
  int num;
  int id;
  bool operator<(const node &a) const { return num < a.num; }
};
int n;
node a[500005];
int ta[500005];
void solve() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i].num, a[i].id = i;
  ;
  sort(a, a + n);
  ta[a[n - 1].id] = a[0].num;
  for (int i = 0; i < n - 1; i++) ta[a[i].id] = a[i + 1].num;
  for (int i = 0; i < n; i++) {
    if (i) cout << " ";
    cout << ta[i];
  }
  cout << endl;
}
int main() {
  int t = 10000;
  solve();
  int mk;
  if (scanf("%d", &mk) == EOF) return 0;
  return 0;
}
