#include <bits/stdc++.h>
using namespace std;
int n, a[100001], b[100001];
vector<int> c;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    c.push_back(a[i]);
  }
  sort(c.begin(), c.end());
  int d = n - 1;
  for (int i = 0; i < (n / 2); i++) {
    b[c[i]] = c[d];
    b[c[d]] = c[i];
    d--;
  }
  for (int i = 0; i < n; i++) {
    if (b[a[i]] == 0 && n % 2 != 0 && i != n - 1)
      cout << a[i] << " ";
    else if (b[a[i]] == 0 && n % 2 != 0 && i == n - 1)
      cout << a[i] << "\n";
    else if (i != n - 1)
      cout << b[a[i]] << " ";
    else
      cout << b[a[i]] << "\n";
  }
}
