#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
typedef tuple<int, int> i2;
typedef tuple<int, int, int> i3;
typedef tuple<int, int, int, int> i4;
typedef vector<int> vi;
typedef vector<i2> vi2;
typedef vector<i3> vi3;
typedef vector<i4> vi4;
typedef vector<vi> v2i;
typedef vector<vi2> v2i2;
typedef vector<string> vs;
typedef vector<long long> vll;
long long modPow(long long b, long long p, long long m) {
  b %= m;
  if (p <= 1) return p == 0 ? 1 : b;
  long long res = modPow(b * b, p / 2, m);
  return p % 2 == 0 ? res : (res * b) % m;
}
int t;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vi v(n);
  for (int i = 0; i < n; ++i) cin >> v[i];
  sort(v.rbegin(), v.rend());
  int k = 0;
  vi res(n);
  for (int i = 1; i < n; i += 2) res[i] = v[k++];
  for (int i = 0; i < n; i += 2) res[i] = v[k++];
  for (int a : res) cout << a << " ";
  cout << '\n';
  return 0;
}
