#include <bits/stdc++.h>
int main() {
  std::ios::sync_with_stdio(0);
  std::cin.tie(0);
  std::cout.tie(0);
  int n;
  std::cin >> n;
  std::vector<int> v;
  for (int i = 0, x; i < n; ++i) std::cin >> x, v.push_back(x);
  std::sort((v).begin(), (v).end());
  for (int i = 1; i + 1 < v.size(); i += 2) std::swap(v[i], v[i + 1]);
  for (int x : v) std::cout << x << ' ';
}
