#include <bits/stdc++.h>
using namespace std;
void faster() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
const long long INF = 1e18;
const long double pi = acos(-1);
const long long MAXN = 1e5 + 123;
long long n, a[MAXN], b[MAXN];
int main() {
  faster();
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  sort(a + 1, a + n + 1);
  int i, j;
  for (i = 1, j = 1; j <= n; ++i, j += 2) {
    b[j] = a[i];
  }
  for (j = 2; j <= n; ++i, j += 2) {
    b[j] = a[i];
  }
  for (i = 1; i <= n; ++i) {
    cout << b[i] << ' ';
  }
  return 0;
}
