#include <bits/stdc++.h>
using namespace std;
const int inf = 1e5 + 7;
int n, x, y;
void test() {
  cin >> n;
  vector<int> arr(n);
  for (int i = 0; i < n; i++) cin >> arr[i];
  sort(arr.begin(), arr.end(), greater<int>());
  deque<int> q;
  while (!arr.empty()) {
    int e = arr.back();
    arr.pop_back();
    q.push_back(e);
    if (arr.empty()) break;
    e = arr.back();
    arr.pop_back();
    q.push_front(e);
  }
  for (int x : q) cout << x << " ";
}
int32_t main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  int T = 1;
  while (T--) {
    test();
    cout << "\n";
  }
  return 0;
}
