#include <bits/stdc++.h>
using namespace std;
vector<long long> v;
vector<long long> sol;
int main() {
  ios::sync_with_stdio(0);
  cout.tie(0);
  cin.tie(0);
  int a;
  cin >> a;
  v.resize(a);
  for (int i = 0; i < a; i++) {
    cin >> v[i];
  }
  sort(v.begin(), v.end());
  long long posme, posma;
  if (a % 2 == 0) {
    posme = a - (a / 2) - 1;
    posma = a - 1;
    for (int i = 1; i <= a; i++) {
      if (i % 2 == 0) {
        sol.push_back(v[posma]);
        posma--;
      } else {
        sol.push_back(v[posme]);
        posme--;
      }
    }
  } else {
    posme = a - (a / 2) - 1;
    posma = a - 1;
    for (int i = 1; i <= a; i++) {
      if (i % 2 == 0) {
        sol.push_back(v[posma]);
        posma--;
      } else {
        if (posme != 0) {
          if (v[posme] > v[posma] || v[posme - 1] > v[posma]) {
            cout << -1 << endl;
            return 0;
          }
        }
        sol.push_back(v[posme]);
        posme--;
      }
    }
  }
  for (int i = 0; i < a; i++) {
    cout << sol[i] << " ";
  }
  cout << endl;
}
