#include <bits/stdc++.h>
using namespace std;
const int hashP = 239017;
const int N = 1e5 + 10;
const int MOD = 1e9 + 7;
const int MOD2 = 998244353;
const int INF = 1e9;
const long long INF2 = 1e18;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  for (auto& now : a) cin >> now;
  sort(a.begin(), a.end());
  for (int i = 0; i < n; i += 2) cout << a[i] << " ";
  if (n % 2) n--;
  for (int i = n - 1; i > 0; i -= 2) cout << a[i] << " ";
  return 0;
}
