#include <algorithm>
#include <iostream>
#include <iomanip>
int main()
{
	const int xcnt = 6 , ycnt = 4;
	
	// pattern
	int ary[xcnt] = {1,2,3,4,5,6};
	std::sort(ary, ary+xcnt);

	// pick ycnt
	int ary_mask[xcnt] = {0};
	std::fill(ary_mask, ary_mask+ycnt, 1);
	std::sort(ary_mask, ary_mask+xcnt);

	// do next_permutation for ary_mask
	int num = 0;
	do {
		// if ary_mask[i] == 1 , output ary[i]
		std::cout << std::setw(3) <<  ++num << " : " ;
		for(auto i = 0; i < xcnt; ++i) 
			if(ary_mask[i])
				std::cout << ary[i] << ' ';
		std::cout << '\n';
	}while(std::next_permutation(ary_mask, ary_mask+xcnt));
	return 0;
}