#include <bits/stdc++.h>
using namespace std;
long long int binaryExponentiation(long long int x, long long int n) {
  if (n == 0)
    return 1;
  else if (n % 2 == 0)
    return binaryExponentiation(x * x, n / 2);
  else
    return x * binaryExponentiation(x * x, (n - 1) / 2);
}
long long int modularExponentiation(long long int x, long long int n,
                                    long long int M) {
  if (n == 0)
    return 1;
  else if (n % 2 == 0)
    return modularExponentiation((x * x) % M, n / 2, M);
  else
    return (x * modularExponentiation((x * x) % M, (n - 1) / 2, M)) % M;
}
bool prime_check(long long x) {
  bool prime = (x >= 2);
  for (long long i = 2; i * i <= x; i++) {
    if (x % i == 0) {
      prime = false;
      break;
    }
  }
  return prime;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  vector<long long int> v(n);
  vector<long long int> a(n);
  for (long long int i = 1; i < n + 1; i++) {
    cin >> v[i - 1];
  }
  sort(v.begin(), v.end());
  for (long long int i = 0; i < n / 2; i++) {
    a[i] = v[2 * i];
    a[n - i - 1] = v[2 * i + 1];
  }
  if (n % 2 == 1) {
    a[n / 2] = v[n - 1];
  }
  for (long long int i = 0; i < n; i++) {
    cout << a[i] << " ";
  }
  return 0;
}
