#include <bits/stdc++.h>
using namespace std;
const int N = 1 << 20;
long long ar[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long n;
  cin >> n;
  for (long long int i = 0; i < n; i++) {
    cin >> ar[i];
  }
  sort(ar, ar + n);
  vector<long long> v;
  for (long long int i = 0; i < n; i++) {
    if (i % 2 == 0) {
      v.emplace(v.begin(), ar[i]);
    } else {
      v.push_back(ar[i]);
    }
  }
  for (auto i : v) cout << i << " ";
}
