#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  scanf("%d", &N);
  long long A[N];
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  sort(A, A + N);
  long long ans[N];
  int index = 0;
  for (int i = 0; i < N; i += 2) {
    ans[i] = A[index++];
  }
  for (int i = 1; i < N; i += 2) {
    ans[i] = A[index++];
  }
  for (int i = 0; i < N; i++) {
    printf("%d ", ans[i]);
  }
  printf("\n");
  return 0;
}
