#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long MAXN = 1e6 + 5;
const long long INF = (1ll << 31) - 1;
const double PI = 3.14159265359;
int n, a[MAXN], b[MAXN];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  sort(a + 1, a + n + 1);
  int pos = 0;
  for (int i = 1; i <= n; ++i) {
    b[i] = a[n - pos];
    ++pos;
    if (pos >= n) break;
    b[n - i + 1] = a[n - pos];
    ++pos;
    if (pos >= n) break;
  }
  for (int i = 1; i <= n; ++i) cout << b[i] << " ";
}
