#include <bits/stdc++.h>
long long int maxx(long long int a, long long int b) { return a > b ? a : b; }
long long int minn(long long int a, long long int b) { return a > b ? b : a; }
using namespace std;
long long int gcd(long long int a, long long int b) {
  return b == 0 ? a : gcd(b, a % b);
}
long long int lcm(long long int a, long long int b) {
  return (a * b) / gcd(a, b);
}
long long int poww(long long int base, long long int exp) {
  base %= 1000000007;
  long long int result = 1;
  while (exp > 0) {
    if (exp & 1) result = (result * base) % 1000000007;
    base = (base * base) % 1000000007;
    exp >>= 1;
  }
  return result;
}
map<int, int> mp;
int main() {
  int n;
  cin >> n;
  vector<pair<int, int>> a, b;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    a.push_back(make_pair(x, i));
    b.push_back(make_pair(x, i));
  }
  sort(a.begin(), a.end());
  for (int i = 0; i < n; i++) mp[a[i].first] = i;
  for (int i = 0; i < n; i++) cout << a[(mp[b[i].first] + 1) % n].first << " ";
}
