#include <bits/stdc++.h>
using namespace std;
long long int ceil2(long long int a, long long int b) {
  return (a + b - 1) / b;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, input;
  vector<int> ice;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> input;
    ice.push_back(input);
  }
  sort(ice.begin(), ice.end());
  vector<int> ans(n);
  for (int i = 0; i < (ceil2(n, 2)); i++) {
    ans[2 * i] = ice[i];
  }
  for (int i = 0; i < (n / 2); i++) {
    ans[1 + (2 * i)] = ice[ceil2(n, 2) + i];
  }
  bool ok = true;
  for (int i = 1; i < n; i++) {
    if (i % 2 == 0) {
      if (ans[i] > ans[i - 1]) {
        ok = false;
        break;
      }
    } else {
      if (ans[i] < ans[i - 1]) {
        ok = false;
        break;
      }
    }
  }
  if (ok) {
    for (auto it : ans) {
      cout << it << " ";
    }
    cout << endl;
  } else {
    cout << "Impossible" << endl;
  }
  ice.clear();
  ans.clear();
  return 0;
}
