#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
using dd = long double;
namespace {
static bool constexpr dbg = 0;
ll constexpr N = 30;
ll n, res[N + 9];
pll d[N + 9];
void init() {
  cin >> n;
  for (ll i = 0, ii_ = (n); i < ii_; ++i) cin >> d[i].first, d[i].second = i;
}
void solve() {
  sort(d, d + n);
  for (ll i = 0, ii_ = (n); i < ii_; ++i)
    res[d[i].second] = d[(i + 1) % n].first;
  for (ll i = 0, ii_ = (n); i < ii_; ++i) cout << res[i] << ' ';
}
}  // namespace
int main() {
  if (!dbg) {
    std::ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
  }
  cout << fixed << setprecision(20);
  init();
  solve();
  return 0;
}
