#include <bits/stdc++.h>
const double pi = 4.0 * atan(1.0);
const double e = exp(1.0);
using namespace std;
const int N = 3e5 + 5;
long long a[N], b[N];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + n + 1);
  int x = (n + 1) >> 1;
  b[x] = a[n];
  int f = 1;
  for (int i = 1; i <= n - 1; i++) {
    b[x + f] = a[n - i];
    if (f > 0)
      f = -f;
    else {
      f = -f + 1;
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << b[i] << ' ';
  }
  cout << endl;
}
