triplets.cpp