#include <bits/stdc++.h>
using namespace std;
int n, a[1000], mas[1000], st, fin;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  sort(a, a + n);
  int cur = 0;
  for (int i = 0; i < n / 2 + n % 2; i++) {
    mas[cur] = a[i];
    cur += 2;
  }
  cur = 1;
  for (int i = n / 2 + n % 2; i < n; i++) {
    mas[cur] = a[i];
    cur += 2;
  }
  for (int i = 0; i < n - 1; i++)
    if (!(i % 2)) {
      if (mas[i] > mas[i + 1]) {
        printf("Impossible\n");
        return 0;
      }
    } else if (mas[i] < mas[i + 1]) {
      printf("Impossible\n");
      return 0;
    }
  for (int i = 0; i < n; i++) printf("%d ", mas[i]);
  printf("\n");
}
