#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a.begin(), a.end());
  vector<int> ans(n);
  int idx = n - 1;
  for (int i = 0; i < n; i++) {
    if (i % 2) {
      ans[i] = a[idx--];
    }
  }
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0) {
      ans[i] = a[idx--];
    }
  }
  bool check = true;
  for (int i = 1; i < n; i++) {
    if (i % 2) {
      if (ans[i] < ans[i - 1]) {
        check = false;
        break;
      }
    } else {
      if (ans[i] > ans[i - 1]) {
        check = false;
        break;
      }
    }
  }
  if (check) {
    for (auto x : ans) cout << x << " ";
    cout << endl;
  } else
    cout << "Impossible" << endl;
  return 0;
}
