Bad Horse (Small 1)

Decide for each test case whether members joined by troublesome pairs split into two groups with no pair in one group.

Easy3GraphBFSInterviewNo attempts yetTime limit5sMemory limit512 MB

Problem

Bad Horse, the leader of the Evil League of Evil, has a lot of problems to deal with. There have been far too many arguments and far too much backstabbing in the League lately, so Bad Horse has decided to split the League into two departments and keep the troublesome members apart. Being the Thoroughbred of Sin, Bad Horse is not about to spend his own time working out how to split the members. That is what he has you, his loyal henchman, for.

You are given a list of troublesome pairs of members. Decide whether the members named in that list can be put into two departments so that no department contains a troublesome pair. One of the two departments may stay empty.

Input

The first line of the input gives the number of test cases, T. T test cases follow. Each test case starts with a positive integer M on a line by itself, the number of troublesome pairs of League members. The next M lines each contain a pair of names, separated by a single space.

Limits

  • 1 ≤ T ≤ 100
  • Each member name consists of only letters and the underscore character.
  • Names are case sensitive.
  • No pair appears more than once in the same test case.
  • Each pair contains two distinct League members.
  • 1 ≤ M ≤ 10

Output

For each test case, output one line containing "Case #x: y", where x is the test case number starting from 1, and y is Yes if the members can be split into two departments with neither department containing a troublesome pair, and No otherwise.