#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define all(x) x.begin(),x.end()
vector<int> solve(vector<int> A){
	sort(all(A));
	vector<int>ans;
	for(int i=0;i<A.size();i+=2){
		ans.pb(i);
	}
	for(int i=1;i<A.size();i+=2){
		ans.pb(i);
	}
	return ans;
}
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	int t; cin>>t;
	int n; cin>>n;
	vector<int>v(n);
	for(int i=0;i<n;i++){
		cin>>v[i];
	}
	vector<int>ans=solve(v);
	for(auto x:ans){
		cout<<x<<" ";
	}
	
}