#include <bits/stdc++.h>
using namespace std;
long long ans = 0, temp, min1 = 10000, r, x, l = 0, pos1 = 0, d, a = 0, pos = 0,
          b = 0, i, n, k = 0, m = 0, t, tot = 0, c = 0, s = 0, t1, c1 = 0,
          k4 = 0, c2 = 0, j = 0, k1 = 0, k2, k3 = 0;
char ch, ch1[2000];
string s1;
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  vector<long long> v(n), v2;
  for (long long i = 0; i < n; i++) cin >> v[i];
  sort(v.begin(), v.end());
  for (long long i = 0; i < n; i++) {
    if (i % 2 != 0) v2.push_back(v[i]);
  }
  sort(v2.begin(), v2.end(), greater<long long>());
  for (long long i = 0; i < n; i++) {
    if (i % 2 == 0) cout << v[i] << " ";
  }
  k1 = v2.size();
  for (long long i = 0; i < k1; i++) cout << v2[i] << " ";
}
