#include <bits/stdc++.h>
using namespace std;
long long m, n, t;
long long sum = 0;
const int ma = 3e5 + 5;
long long a[ma], b[ma], c[ma];
int main() {
  long long s;
  cin >> n;
  for (long long int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  vector<long long> v, v1;
  for (long long int i = 0; i < n; i++) {
    if (i % 2 == 0)
      v.push_back(a[i]);
    else
      v1.push_back(a[i]);
  }
  vector<long long> v2(v1);
  reverse(v.begin(), v.end());
  v2.insert(v2.end(), v.begin(), v.end());
  for (long long int i = 0; i < n; i++) cout << v2[i] << " ";
}
