#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, A[1000];
  cin >> N;
  for (int i = 0; i < N; ++i) cin >> A[i];
  sort(A, A + N);
  int j = N - 1;
  for (int i = 0; i <= j; i++) {
    if (i == j)
      cout << A[i];
    else
      cout << A[i] << " " << A[j--] << " ";
  }
  return 0;
}
