#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, i, a[200009], x, cn = 0, cnn = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  for (i = 0; i < n; i++) {
    if ((i + 1) % 2 != 0 && i + 1 != 1) {
      if (a[i] > a[i - 1]) {
        x = a[i];
        a[i] = a[i - 1];
        a[i - 1] = x;
      }
    } else {
      if (i != 0 && a[i] < a[i - 1]) {
        x = a[i];
        a[i] = a[i - 1];
        a[i - 1] = x;
      }
    }
  }
  for (i = 0; i < n; i++) {
    if ((i + 1) % 2 != 0 && i + 1 != 1) {
      cn++;
    } else {
      if (a[i] < a[i - 1]) {
        cnn++;
      }
    }
    if (cn == 0) {
      for (i = 0; i < n; i++) {
        cout << a[i] << " ";
      }
    } else
      cout << "Impossible";
  }
}
