#include <bits/stdc++.h>
using namespace std;
bool comp(int a, int b) {
  if (a > b)
    return 1;
  else
    return 0;
}
int main() {
  int a[1001] = {0}, b[1001] = {0};
  int n;
  int d = 0;
  cin >> n;
  if (n % 2) d = 1;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  int l = 0, r = n - 1;
  while (r - l > 0) cout << a[l++] << ' ' << a[r--] << ' ';
  if (n % 2) cout << a[l];
}
