#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, i, j, t, c;
  cin >> n;
  long long int a[n + 1], b[n + 1], l = 1, r = n;
  for (i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  c = 0, t = n, j = 1;
  while (t--) {
    if (c == 0) {
      b[l] = a[j];
      l++;
      j++;
      c = 1;
    } else {
      b[r] = a[j];
      r--;
      j++;
      c = 0;
    }
  }
  for (i = 1; i <= n; i++) cout << b[i] << " ";
  cout << endl;
}
