#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, i = 0, j;
  cin >> n;
  j = n - 1;
  int arr[n], dup[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    dup[i] = arr[i];
  }
  sort(dup, dup + n);
  if (n == 1)
    cout << dup[0];
  else {
    if (n % 2 == 0) {
      while (i < j) {
        cout << dup[i] << " " << dup[j] << " ";
        i++;
        j--;
      }
    } else {
      while (i <= j) {
        if (i == j) {
          cout << dup[i];
          i++;
          j--;
        } else {
          cout << dup[i] << " " << dup[j] << " ";
          i++;
          j--;
        }
      }
    }
  }
  return 0;
}
