#include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  cin >> a;
  int b[a];
  for (int k = 0; k < a; k++) cin >> b[k];
  sort(b, b + a);
  for (int k = 0; k < a / 2; k++) cout << b[k] << " " << b[a - k - 1] << " ";
  if (a % 2 == 1) {
    cout << b[(a - 1) / 2];
  }
}
