Bingo is a game played on a 5 by 5 board called a card. There are many variations, but Bob's Bingo uses the following rules:
Two different cards may both be winners for a given pattern. Consider the cards and pattern below:
Both of these cards are winners when the numbers 1, 2, 7, 8, 13, 14, 19, 20, and 25 are selected. These are considered to be equivalent cards.
Bob's Bingo players get mad when they have two equivalent cards (since it reduces their chance to win) or when one of their cards is equivalent to a card of another player (since they have to share the prize). Bob wants you to write a program to go through his stack of cards and identify the equivalent cards.
X____
XX___
_XX__
__XX_
___XX
4
1 6 11 16 21
2 7 12 17 22
3 8 13 18 23
4 9 14 19 24
5 10 15 20 25
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
16 17 18 19 20
21 22 23 24 25
7 18 60 64 65
14 19 4 21 50
40 20 25 52 5
49 75 13 2 43
74 63 9 8 1
1 3 4 5 6
2 7 31 32 33
34 13 8 35 36
37 38 19 14 39
40 41 42 20 25
_XXX_
X_X_X
XXXXX
X_X_X
_XXX_
2
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
16 17 18 19 20
21 22 23 24 25
25 24 23 22 21
20 19 18 17 16
15 14 13 12 11
10 9 8 7 6
5 4 3 2 1
X____
XX___
_XX__
__XX_
___XX
0
Game 1
Card 3 is equivalent to card 1
Card 4 is equivalent to card 1
Game 2
Card 2 is equivalent to card 1