#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  long long int a[n];
  vector<int> v;
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
    v.push_back(a[i]);
  }
  sort(v.begin(), v.end());
  long long int x = 0, y = v.size() - 1;
  for (int i = 1; i <= v.size(); i++) {
    if (i % 2 == 0)
      cout << v[y] << " ", y--;
    else
      cout << v[x] << " ", x++;
  }
}
