#include <bits/stdc++.h>
using namespace std;
set<int> st;
set<int>::iterator it;
map<int, int> mp;
map<int, int>::iterator itr;
queue<int> q;
stack<int> stk;
priority_queue<int> pq;
vector<int> v;
vector<int> v1;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL), cout.tie(NULL);
  long long a, p;
  cin >> a;
  p = a;
  while (a--) {
    int l;
    cin >> l;
    v.push_back(l);
  }
  for (int i = 0; i < p; i += 2)
    for (int j = i + 1; j < p; j++)
      if (v[i] > v[j]) swap(v[i], v[j]);
  for (int i = 1; i < p; i += 2)
    for (int j = i + 1; j < p; j++)
      if (v[i] < v[j]) swap(v[i], v[j]);
  for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
}
