#include <bits/stdc++.h>
using namespace std;
long long int N = pow(10, 12);
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  long long int arr[n];
  long long int ans[n];
  for (int i = 0; i < n; i++) {
    long long int a;
    cin >> a;
    arr[i] = a;
  }
  sort(arr, arr + n);
  int j = 0;
  for (int i = 0; i < n; i += 2) {
    ans[i] = arr[j];
    j++;
  }
  for (int i = 1; i < n; i += 2) {
    ans[i] = arr[j];
    j++;
  }
  for (int i = 0; i < n; i++) {
    cout << ans[i] << " ";
  }
}
