#include <bits/stdc++.h>
using namespace std;
ifstream fin("Sisend.txt");
long long n, c;
vector<long long> v;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cerr.tie(0);
  cin >> n;
  for (int(i) = (0); ((i)) < ((n)); ((i))++) {
    cin >> c;
    v.emplace_back(c);
  }
  sort(v.begin(), v.end());
  for (int(i) = (0); ((i)) < ((n)); ((i))++)
    if (i % 2 == 0) cout << v[i] << " ";
  for (int i = n - 1; i >= 0; i--)
    if ((i % 2) == 1) cout << v[i] << " ";
}
