#include <bits/stdc++.h>
using namespace std;
const long long N = 110;
const long long inf = 1e9;
long long n;
long long a[N];
signed main() {
  scanf("%lld", &n);
  for (long long i = 1; i <= n; i++) scanf("%lld", &a[i]);
  sort(a + 1, a + n + 1);
  vector<long long> c, b;
  for (long long i = 2; i < n; i += 2) c.push_back(a[i]);
  for (long long i = 3; i < n; i += 2) b.push_back(a[i]);
  printf("%d ", a[1]);
  for (long long i = 0; i < (long long)c.size(); i++) printf("%d ", c[i]);
  printf("%d ", a[n]);
  reverse(b.begin(), b.end());
  for (long long i = 0; i < (long long)b.size(); i++) printf("%d ", b[i]);
  printf("\n");
  return 0;
}
