#include <bits/stdc++.h>
int a[1010], b[1010], n;
void sort(int sta, int end) {
  if (sta >= end) return;
  int i, j, t;
  i = sta;
  j = end;
  while (i != j) {
    while (a[j] >= a[sta]) {
      if (i >= j) break;
      j--;
    }
    while (a[i] <= a[sta]) {
      if (i >= j) break;
      i++;
    }
    t = a[i];
    a[i] = a[j];
    a[j] = t;
  }
  t = a[sta];
  a[sta] = a[i];
  a[i] = t;
  sort(sta, i - 1);
  sort(i + 1, end);
}
void sort1() {
  int i = 1, j1, j2, j;
  for (i = 1; i <= n; i++) b[i] = a[i];
  i = 1;
  for (j = 1; j <= n; j += 2) {
    a[j] = b[i++];
  }
  for (j = 2; j <= n; j += 2) {
    a[j] = b[i++];
  }
}
int main() {
  int i;
  while (scanf("%d", &n) != EOF) {
    memset(a, 0, sizeof(a));
    memset(b, 0, sizeof(b));
    for (i = 1; i <= n; i++) scanf("%d", &a[i]);
    sort(1, n);
    sort1();
    int flag = 1;
    for (i = 2; i <= n; i++) {
      if (i % 2 == 1) {
        if (a[i - 1] < a[i]) {
          flag = 0;
          ;
          break;
        }
      } else {
        if (a[i] < a[i - 1]) {
          flag = 0;
          break;
        }
      }
    }
    if (flag) {
      for (i = 1; i <= n; i++) printf("%d ", a[i]);
      printf("\n");
    } else
      printf("Impossible\n");
  }
}
