#include <bits/stdc++.h>
using namespace std;
long long multiple(long long a, long long b, long long c) {
  if (b == 0) return 0;
  long long ret = multiple(a, b >> 1, c);
  ret = (ret + ret) % c;
  if (b & 1) ret = (ret + a) % c;
  return ret;
}
long long a[2000], b[2000], final[200];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, i, j, diff1, diff2, flag = 0, pos, max1, max2, diff3, diff4,
                                   diff5, diff6, diff7, diff8;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    b[i] = a[i];
  }
  sort(b, b + n);
  if (n <= 3) {
    for (i = 0; i < n; i++) {
      cout << b[i] << " ";
    }
    exit(0);
  }
  for (i = 0; i < n; i += 2) {
    cout << b[i] << " ";
  }
  if ((n - 1) % 2 != 0) {
    for (i = n - 1; i >= 1; i -= 2) {
      cout << b[i] << " ";
    }
  } else {
    for (i = n - 2; i >= 1; i -= 2) {
      cout << b[i] << " ";
    }
  }
}
