#include <iostream>
#include <array>
#include <algorithm>
#include <iterator>
using namespace std;

using table = array<int, 3>;

table sorted(const table &input){
	int a = input[0], b = input[1], c = input[2];
	if(a > b) swap(a, b);
	if(a > c) swap(a, c);
	if(b > c) swap(b, c);
	
	return {a, b, c};
}

template <class T, std::size_t N>
ostream& operator<<(ostream& o, const array<T, N>& arr){
    copy(arr.cbegin(), arr.cend(), ostream_iterator<T>(o, " "));
    return o;
}

template<typename T1, typename T2>
void assert_equal(const T1 &lhs, const T2 &rhs){
	if(!(lhs == rhs)){
		cout << "Assertion failed!\n";
		cout << "lhs: " << lhs << ", rhs: " << rhs << endl;
	}
}

int main() {
	table expected = {1, 2, 3};
	
	table arg = expected;
	do{
		cout << "( " << arg << ")\n";
		assert_equal(sorted(arg), expected);
	}while(next_permutation(begin(arg), end(arg)));

	return 0;
}