#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
const long long LL_INF = 0x3f3f3f3f3f3f3f3f;
template <typename T>
T gcd(T a, T b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long power(long long a, long long b, long long m = 1000000007) {
  long long answer = 1;
  while (b) {
    if (b & 1) answer = (answer * a) % m;
    b /= 2;
    a = (a * a) % m;
  }
  return answer;
}
using namespace std;
void ctrl() { cout << "Control\n"; }
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  long long A[n], B[n];
  vector<pair<long long, long long> > v;
  for (register long long i = 0; i < n; i += 1) {
    cin >> A[i];
    v.push_back(make_pair(A[i], i));
  }
  sort(v.begin(), v.end());
  for (long long i = 1; i < n; i++) {
    B[v[i - 1].second] = v[i].first;
  }
  B[v[n - 1].second] = v[0].first;
  for (auto it : B) cout << it << " ";
  return 0;
}
