#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:102400000,102400000")
const int N = 200005;
int n, b[N];
pair<int, int> p[N];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &p[i].first), p[i].second = i;
  sort(p + 1, p + 1 + n);
  b[p[1].second] = p[n].first;
  for (int i = 2; i <= n; ++i) b[p[i].second] = p[i - 1].first;
  for (int i = 1; i <= n; ++i) printf("%d ", b[i]);
  return 0;
}
