#include<bits/stdc++.h> using namespace std; int main() { int k,n[20],a,b,c,d,e,f; while(scanf("%d",&k)!=EOF) { for(int i=0; i<k; i++) scanf("%d",&n[i]); for(a=0; a<=k-6; a++) { for(b=a+1; b<=k-5; b++) { for(c=b+1; c<=k-4; c++) { for(d=c+1; d<=k-3; d++) { for(e=d+1; e<=k-2; e++) { for(f=e+1; f<=k-1; f++) { cout<<n[a]<<" "<<n[b]<<" "<<n[c]<<" "<<n[d]<<" "<<n[e]<<" "<<n[f]<<endl; } } } } } } cout<<endl; } return 0; }