#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
int a[N];
int b[N];
set<int> st;
int main() {
  int n, ans = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> b[i];
  }
  sort(b + 1, b + n + 1);
  int l = 1, h = n;
  for (int i = 1; i <= n; i++) {
    if (i % 2 == 0) {
      a[i] = b[h];
      h--;
    } else {
      a[i] = b[l];
      l++;
    }
    cout << a[i] << " ";
  }
}
