#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1e9 + 7;
vector<long long int> pec, vec;
map<long long int, long long int> has;
long long int ar[445522], br[22334];
inline long long int powr(long long int a, long long int b) {
  if (b == 0) return 1;
  long long int x = powr(a, b / 2);
  if (b % 2 == 0)
    return (x * x) % MOD;
  else
    return (((x * x) % MOD) * a) % MOD;
}
inline long long int inv(long long int x) { return powr(x, MOD - 2); }
inline long long int mulMod(long long int a, long long int b) {
  return (a % MOD * b % MOD) % MOD;
}
long long int adder(long long int a, long long int b) {
  long long int res = a + b;
  if (res > MOD) {
    return res % MOD;
  }
  return res;
}
long long int multiplier(long long int a, long long int b) {
  long long int res = a * b;
  if (res > MOD) {
    return res % MOD;
  }
  return res;
}
int main() {
  long long int t, n, m, a, b, c, d, res, flag, x, y, z, p, q, r, s, u, v, sum,
      ans, i, j, k, l, minm, maxm;
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  vector<long long int>::iterator it, jt;
  string str, ptr;
  minm = INT_MIN;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> ar[i];
  }
  sort(ar, ar + n);
  for (i = 1; i <= n; i++) {
    p = (i + 1) % n;
    if (p == 0) {
      p = n;
    }
    minm = max(minm, abs(ar[i] - ar[p]));
    br[i] = ar[i];
  }
  for (i = 0; i < n; i += 2) {
    cout << ar[i] << " ";
  }
  if (i == n)
    r = n - 1;
  else
    r = n - 2;
  for (i = r; i >= 0; i -= 2) {
    cout << ar[i] << " ";
  }
  return 0;
}
