Once upon a time, in the La Leuga football league, there were only three football teams: Team A, Team B, and Team C. Each team played against each other exactly once. So each team had to play two matches. For a win a team gets 3 points, for a draw each team gets 1 point and for a loss they don’t get any points. The point table at the end of the season was as follows.
Team Name | Points |
---|---|
Team A | 6 |
Team B | 4 |
Team C | 1 |
One day, a football fan was looking at the point table (the table is sorted based on team name) and noticed something strange. Team A has 6 points, which means they must have won both of their matches. However, Team B has 4 points, which means team B must not have lost any matches. This is a contradiction since Team A must have won their match against Team B and Team C. Therefore, the point table is invalid.
So, the La Liga authority decided to investigate further and asked for your help. You are given the points of team A, team B and team C. You have to figure out whether the given table is invalid or not.
Input
The first line will contain a single integer T (1 ≤ T ≤ 350), denoting the number of test cases. Each test case will have three integers PA, PB, and PC (0 ≤ PA, PB, PC ≤ 6), denoting their points in a single line.
Output
For each of the cases output Case <x>: <y>
in a separate line, where x is the case number and y is the desired answer. If the point table is invalid, then print invalidum
, otherwise print perfectus
.
Sample
Sample Input | Sample Output |
---|---|
3 6 1 1 3 3 3 6 6 6 | Case 1: perfectus Case 2: perfectus Case 3: invalidum |