#include <bits/stdc++.h>
using namespace std;
int main(int argc, char **argv) {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int result[n / 2];
  int temp;
  for (int i = 0; i < n / 2; i++) {
    for (int j = i + 1; j < n; j++) {
      if (a[i] < a[j]) {
        temp = a[i];
        a[i] = a[j];
        a[j] = temp;
      }
    }
    result[i] = a[i];
  }
  for (int i = 0, j = n / 2, k = 0; i < n; i++) {
    if (i % 2 == 0) {
      cout << a[j] << " ";
      j++;
    } else {
      cout << a[k] << " ";
      k++;
    }
  }
  return 0;
}
