#include <bits/stdc++.h>
using namespace std;
int ar[30];
int br[30];
unordered_map<long, long> nm;
int main() {
  std::ios::sync_with_stdio(false);
  ;
  int n;
  std::cin >> n;
  for (int i = 0; i < n; i++) {
    std::cin >> ar[i];
    br[i] = ar[i];
    nm[ar[i]] = i;
  }
  sort(ar, ar + n);
  for (int i = 0; i < n - 1; i++) {
    br[nm[ar[i]]] = ar[i + 1];
  }
  br[nm[ar[n - 1]]] = ar[0];
  for (int i = 0; i < n; i++) {
    std::cout << br[i] << " ";
  }
  return 0;
}
