#include <iostream>
#include <algorithm>
using namespace std;
int main(){
int n;
cin>>n;
int a[n+1],b[n+1];
for(int i=1;i<=n;i++) cin>>a[i];
sort(a+1,a+n+1);
int f=1,j=0,pos=(n+1)/2;
b[(n+1)/2]=a[n];
for(int i=n-1;i>=1;i--){
j++;
pos=pos+f*j;
b[pos]=a[i];
f=-f;
}
for(int i=1;i<=n;i++)
cout<<b[i]<<" ";
return 0;
}