#include <bits/stdc++.h>
#define long long ll;
using namespace std;

int main(){
    int n;
    cin>>n;
    vector<int> xs(n);
    for(int i=0;i<n;i++){
        cin>>xs[i];
    }

    sort(xs.begin(),xs.end());
    if(n==2){
        cout<<xs[0]<<" "<<xs[1]<<endl;
    }else{
        if(n%2==0){
            for(int i=0;i<n;i+=2){
                cout<<xs[i]<<" ";
            }
            for(int i=n-1;i>0;i-=2){
                cout<<xs[i]<<" ";
            }
        }else{
            for(int i=0;i<n;i+=2){
                cout<<xs[i]<<" ";
            }
            for(int i=n-2;i>0;i-=2){
                cout<<xs[i]<<" ";
            }
        }
    }

    cout<<endl;
}