#include #define REP(i,n) for(int i=0;i<(n);i++) #define ALL(v) (v).begin(),(v).end() #define int long long using namespace std; //----------------------------------------------------------------------- signed main() { int N,M; cin>>N>>M; vector a(N); REP(i,N){ cin>>a[i]; } sort(ALL(a)); vector ans(M); int maxVal=-1; for(int c=0;c<100;c++) { int sum=0; REP(i,M) sum^=a[i]; if(sum>maxVal){ maxVal=sum; REP(i,M) ans[i]=a[i]; } for(int i=1;imaxVal){ maxVal=sum; REP(j,M) ans[j]=a[i+j]; } } random_shuffle(ALL(a)); } REP(i,M){ if(i) cout<<' '; cout<