In the factory of JOI Co., Ltd., there are N tables, numbered from 0 to N−1. In the factory, there are N−1 belt conveyors, numbered from 0 to N−2. The belt conveyor i (0≤i≤N−2) connects the table A_i and the table B_i. It transports products from one table to the other table. However, we cannot see the direction of transportation. If we ignore the directions of the belt conveyors, every pair of tables is connected by a number of belt conveyors.
IOI-kun is the director of the factory. Since he forgets the direction of transportation of every belt conveyor, he will perform the following sequential operations several times.
He chooses a number of belt conveyors, and reverses the directions of transportation of the chosen belt conveyors.
He chooses a number of tables, and puts a product on each chosen table.
For every table where a product is put, one of the following happens simultaneously.
IOI-kun confirms whether there are one or more products on each table. If there are products on a table, IOI-kun takes all of them.
For every belt conveyor whose direction is reversed in the operation 1., IOI-kun reverts its direction. Its direction becomes the original direction.
IOI-kun wants to specify the original direction of every belt conveyor by performing the above sequential operations at most 30 times.
All the input data satisfy the following conditions.