문제
A triangle tree is an undirected graph in which every cycle contains exactly three edges. Recall that a cycle is a sequence of at least distinct vertices such that there is an edge between and for and there is also an edge between and .
A colouring of a graph is an assignment of colours to the vertices such that the two endpoints of each edge of the graph receive different colours. Given a triangle tree, your task is to find a colouring which uses the smallest possible number of colours.
Figure 1: Illustration of the second sample case. The number written just outside the vertex corresponds to the colour it receives corresponding to the output for that sample case.