#include <bits/stdc++.h>
using namespace std;
namespace fast_IO {
inline int read_int() {
  register int ret = 0, f = 1;
  register char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    ret = (ret << 1) + (ret << 3) + int(c - 48);
    c = getchar();
  }
  return ret * f;
}
}  // namespace fast_IO
using namespace fast_IO;
int N;
int a[1005];
int t[1005];
priority_queue<int> q;
inline void init() {
  N = read_int();
  for (register int i = 1; i <= N; i++) a[i] = read_int(), q.push(-a[i]);
  int l, r;
  l = 500, r = 500;
  int u = -q.top();
  q.pop();
  t[l] = u;
  for (register int i = 2; i <= N; i++) {
    u = -q.top();
    q.pop();
    if (t[l] > t[r])
      t[++r] = u;
    else
      t[--l] = u;
  }
  for (register int i = l; i <= r; i++) printf("%d ", t[i]);
}
int main() {
  init();
  return 0;
}
