#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i;
  int a[1111];
  cin >> n;
  for (i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  for (i = 2; i < n; i += 2) {
    int c = a[i];
    a[i] = a[i - 1];
    a[i - 1] = c;
  }
  for (i = 0; i < n; i++) cout << a[i] << " ";
  cout << endl;
}
