#include <bits/stdc++.h>
using namespace std;
int n;
int a[1005];
int b[1005];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  int p = 0;
  for (int i = 1; i <= n; i += 2) {
    b[i] = a[p++];
  }
  for (int i = 2; i <= n; i += 2) {
    b[i] = a[p++];
  }
  bool f = 1;
  for (int i = 1; i <= n; i++) {
    if (i % 2 == 0) {
      if (i != 1) {
        if (b[i] < b[i - 1]) {
          f = 0;
          break;
        }
      }
    } else {
      if (i != 1) {
        if (b[i] > b[i - 1]) {
          f = 0;
          break;
        }
      }
    }
  }
  if (f) {
    for (int i = 1; i <= n; i++) {
      cout << b[i] << " ";
    }
  } else {
    cout << "Impossible" << endl;
  }
  return 0;
}
