#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<long long> a(n), b(n);
  for (auto &i : a) cin >> i;
  sort(a.begin(), a.end());
  long long l = 0, r = n - 1;
  for (long long i = 0; i < n; i++) {
    if (i % 2 == 0)
      b[l] = a[i], l++;
    else
      b[r] = a[i], r--;
  }
  for (auto p : b) cout << p << ' ';
}
