A cactus is an undirected graph in which every vertex lies on at most one simple cycle. A simple cycle is a closed walk that returns to the vertex it started from without visiting any vertex twice.
If two cycles share a vertex, that vertex lies on two simple cycles, so the graph is not a cactus. Two triangles that meet at a single vertex already fail the condition.
You are given a connected graph. Decide whether it is a cactus.
The first line contains two integers N and M, the number of vertices and the number of edges, separated by a space. (1≤N,M≤100000)
Each of the next M lines contains two integers x and y, the endpoints of one edge, separated by a space. (1≤x,y≤N, x=y)
No edge is given twice, and a path exists between every pair of vertices.
Print Cactus if the given graph is a cactus, and Not cactus otherwise.