#include <bits/stdc++.h>
using namespace std;
int n, tot;
int a[200010];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
  }
  sort(a + 1, a + n + 1);
  int l = 1, r = n;
  while (l <= r) {
    tot++;
    if (tot & 1)
      cout << a[l] << " ", l++;
    else
      cout << a[r] << " ", r--;
  }
  return 0;
}
