#include <bits/stdc++.h>
using namespace std;
int a[2000], b[2000], c[2005];
bool cmp1(int a, int b) { return a < b; }
bool cmp2(int a, int b) { return a > b; }
int main() {
  int n;
  scanf("%d", &n);
  int count_ = 0, flag = 0;
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  sort(a, a + n, cmp1);
  if (n % 2 == 1) {
    for (int i = n / 2 + 1; i < n; i++) {
      b[count_] = a[i];
      count_++;
    }
  } else {
    for (int i = n / 2; i < n; i++) {
      b[count_] = a[i];
      count_++;
    }
  }
  sort(b, b + count_, cmp2);
  int index1 = 0, index2 = 0;
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0) {
      c[i] = a[index1];
      index1++;
    } else {
      c[i] = b[index2];
      index2++;
    }
  }
  for (int i = 0; i < n; i++) printf("%d%c", c[i], i == n - 1 ? '\n' : ' ');
  return 0;
}
