#include<stdio.h>
int main()
{
int a[20],b[20];
int n,i,j,t,mid;
scanf("%d",&n);
for(i=0;i<n;++i)
scanf("%d",&a[i]);
for(i=0;i<n;++i)
for(j=0;j<n-1-i;++j)
{
if(a[j]>a[j+1]){
t=a[j];a[j]=a[j+1];a[j+1]=t;
}
}
for(i=0;i<n;++i)
b[i]=a[i];
mid=(1+n)/2-1;a[mid]=a[n-1];
printf("%d ",a[0]);
for(i=1,j=0;i<mid;++i)
{
j=j+2;
a[i]=a[j];
printf("%d ",a[i]);
}
printf("%d ",a[mid]);
for(i=mid+1,j=n;i<n;++i)
{
j=j-2;b[i]=b[j];
printf("%d ",b[i]);
}
}