#include <bits/stdc++.h>
using namespace std;
long long n;
vector<pair<long long, long long> > vec;
long long ans[25];
int main(void) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  long long x;
  for (long long(i) = (0); (i) <= (n - 1); (i)++) {
    cin >> x;
    vec.push_back(pair<long long, long long>(x, i));
  }
  sort((vec).begin(), (vec).end());
  for (long long(i) = (0); (i) <= (n - 1); (i)++)
    ans[vec[i].second] = vec[(i + 1) % n].first;
  for (long long(i) = (0); (i) <= (n - 1); (i)++) cout << ans[i] << " ";
  cout << endl;
  return 0;
}
