#include <bits/stdc++.h>
using namespace std;
const int maxn = 510;
int n, b[maxn];
struct node {
  int x, pos;
} a[maxn];
bool com(node a, node b) { return a.x < b.x; }
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i].x);
    a[i].pos = i;
  }
  sort(a, a + n, com);
  for (int i = 0; i < n; ++i) {
    b[a[i].pos] = a[(i + 1) % n].x;
  }
  for (int i = 0; i < n; ++i) {
    printf("%d ", b[i]);
  }
  return 0;
}
