#include <bits/stdc++.h>
using namespace std;
int a[210000], b[210000], n;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(a + 1, a + n + 1);
  int now = 0;
  for (int i = 1; i <= n; i += 2) {
    b[i] = a[++now];
  }
  for (int i = 2; i <= n; i += 2) {
    b[i] = a[++now];
  }
  for (int i = 1; i <= n; i++) {
    printf("%d ", b[i]);
  }
  return 0;
}
