#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  vector<long long> v(n, 0), f, s;
  for (long long i = 0; i < n; i += 1) cin >> v[i];
  sort(v.begin(), v.end());
  long long arr[n];
  s.push_back(v[0]);
  for (long long i = 1; i < n; i = i + 2) s.push_back(v[i]);
  for (long long i = 2; i < n; i = i + 2) f.push_back(v[i]);
  reverse(f.begin(), f.end());
  for (long long i = 0; i < f.size(); i++) cout << f[i] << " ";
  for (long long i = 0; i < s.size(); i++) cout << s[i] << " ";
  return 0;
}
