#include <bits/stdc++.h>
using namespace std;
const double g = 10.0, eps = 1e-12;
const int N = 500 + 10, maxn = 10000 + 10, inf = 0x3f3f3f3f;
int a[N], b[N], c[N];
bool cmp(int x, int y) { return a[x] < a[y]; }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i], c[i] = i;
  sort(c, c + n, cmp);
  for (int i = 0; i < n - 1; i++) b[c[i]] = a[c[i + 1]];
  b[c[n - 1]] = a[c[0]];
  for (int i = 0; i < n; i++) cout << b[i] << " ";
  return 0;
}
