#include <bits/stdc++.h>
using namespace std;
int main() {
  long int n;
  while (cin >> n) {
    long long ar[1020] = {0}, i, j;
    for (i = 0; i < n; i++) {
      cin >> ar[i];
    }
    sort(ar, ar + n);
    j = n - 1;
    for (i = 0; i < n / 2; i++) {
      cout << ar[i] << " " << ar[j] << " ";
      j--;
    }
    if (n % 2 == 1) {
      cout << ar[i];
    }
  }
}
