#include <bits/stdc++.h>
using namespace std;
const int maxn = 30;
int ans[maxn];
struct E {
  int id, x;
  inline bool operator<(const E& other) const { return this->x < other.x; }
} aa[maxn];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &aa[i].x);
    aa[i].id = i;
  }
  sort(aa + 1, aa + n + 1);
  for (int i = 1; i < n; ++i) ans[aa[i].id] = aa[i + 1].x;
  ans[aa[n].id] = aa[1].x;
  for (int i = 1; i <= n; ++i) printf("%d ", ans[i]);
  return 0;
}
