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