John Digger is the owner of a large illudium phosdex mine. The mine consists of a series of tunnels that meet at various large junctions. Unlike some owners, Digger cares about the welfare of his workers and is concerned about the mine layout. Specifically, he worries that there might be a junction which, in case of collapse, will cut off workers in one part of the mine from others (illudium phosdex, as you know, is highly unstable). To prevent this, he wants to install special escape shafts from the junctions to the surface. He could install an escape shaft at each junction, but Digger does not care about his workers that much. Instead, he wants to install the minimum number of escape shafts so that if any of the junctions collapses, all workers who survive the collapse will have a path to the surface.
Write a program to compute the minimum number of escape shafts and the total number of ways this minimum number of escape shafts can be installed.
The input consists of several test cases. The first line of each case contains a positive integer (N \leq 5 \cdot 10^4), indicating the number of mine tunnels. This is followed by lines, each containing two distinct integers and , where and are junction numbers. Junctions are numbered consecutively, starting at . Each pair of junctions is joined by at most a single tunnel. Each set of mine tunnels forms one connected unit (that is, you can get from any one junction to any other).
The last test case is followed by a line containing a single zero.
For each test case, output its case number, then the minimum number of escape shafts needed for the system of mine tunnels, and the total number of ways these escape shafts can be installed. You may assume that the result fits in a signed -bit integer.
Follow the format of the sample output.
Example 1