#include <bits/stdc++.h>
using namespace std;
vector<int> v, VV, boro, choto;
int main() {
  int n, st;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> st;
    v.push_back(st);
  }
  if (n == 1) {
    cout << v[0];
    return 0;
  }
  sort(v.begin(), v.end());
  if (n % 2 == 0) {
    for (int i = 0; i <= n / 2 - 1; i++) {
      choto.push_back(v[i]);
    }
    for (int i = n / 2; i <= n - 1; i++) {
      boro.push_back(v[i]);
    }
  } else {
    for (int i = 0; i <= n / 2; i++) {
      choto.push_back(v[i]);
    }
    for (int i = n / 2 + 1; i <= n - 1; i++) {
      boro.push_back(v[i]);
    }
  }
  if (n % 2 == 0) {
    for (int i = 0; i <= min(boro.size(), choto.size()) - 1; i++) {
      VV.push_back(choto[i]);
      VV.push_back(boro[i]);
    }
  } else {
    for (int i = 0; i <= min(boro.size(), choto.size()) - 1; i++) {
      VV.push_back(choto[i]);
      VV.push_back(boro[i]);
    }
    VV.push_back(choto[choto.size() - 1]);
  }
  for (int i = 0; i <= VV.size() - 1; i++) {
    if (i == 0)
      continue;
    else if (i % 2 != 0 && VV[i] < VV[i - 1]) {
      cout << "Impossible";
      return 0;
    } else if (i % 2 == 0 && VV[i] > VV[i - 1]) {
      cout << "Impossible";
      return 0;
    } else
      continue;
  }
  for (int i = 0; i <= VV.size() - 1; i++) cout << VV[i] << " ";
  return 0;
}
