Generation of Three Partition Problem