#include <bits/stdc++.h>
using namespace std;
const int MX_SZ = 1042;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  int a[MX_SZ];
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + n + 1);
  int b[MX_SZ];
  int p = 1;
  for (int i = 1; i <= (n + 1) / 2; i++) {
    b[p] = a[i];
    p += 2;
  }
  p = 2;
  for (int i = ((n + 1) / 2) + 1; i <= n; i++) {
    b[p] = a[i];
    p += 2;
  }
  bool bad = false;
  for (int i = 1; i <= n; i++) {
    if (i != 1 and ((i % 2 == 0 and b[i] < b[i - 1]) or
                    (i % 2 == 1 and b[i] > b[i - 1]))) {
      bad = true;
      break;
    }
  }
  if (bad) {
    cout << "Impossible";
  } else {
    for (int i = 1; i <= n; i++) {
      cout << b[i] << " ";
    }
  }
}
