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