#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int64_t n;
  cin >> n;
  int64_t arr[n], cur[n];
  for (int64_t(i) = (0); (i) < (n); ++i) {
    cin >> arr[i];
    cur[i] = arr[i];
  }
  sort(cur, cur + n);
  for (int64_t(i) = (0); (i) < (n); ++i)
    cout << cur[(upper_bound(cur, cur + n, arr[i]) - cur) % n] << ' ';
  return 0;
}
