Bingo 

The game of BINGO is another of the great American pastimes. Our version of BINGO is to be played on a square card containing a 5 tex2html_wrap_inline26 matrix. The first five lines of the input file will each contain five integer values separated by spaces in the range tex2html_wrap_inline28 ; these values are to be placed in the corresponding row of the matrix from left to right. Immediately following the values for the card will be a series of lines each containing one ``called" number such that tex2html_wrap_inline30 ; the last line will contain an invalid ``called" number of zero (0).

Input

For this problem, you are to write a program that accepts the integers that are to be placed in the cells of a ``BINGO" card. Then you are to read in the ``called" values, which may or may not be the same as the numbers on your BINGO card, one at a time until you either find a BINGO, or you run out of called numbers.

A BINGO occurs when one of the following rules has been fulfilled:

  1. Each of the five elements in a row have either been matched by a called number, or are FREE,
  2. Each of the five elements in a column have either been matched by a called number, or are FREE,
  3. Each of the four corner elements have either been matched by a called number, or are FREE.
  4. Each of the five elements in either prime diagonal have been matched by a called number or are FREE.

Any element in the matrix containing a zero (0) after the original load is FREE, and is considered to have been matched.

Output

If you run out of called numbers before you find a BINGO, you are to print out the following message immediately following the last valid ``called" number:

No BINGO on this card.

If you find a BINGO at some point in the input, you are to stop reading the input values, and print out a notification of the BINGO followed by a list of comma separated triples in ROW MAJOR Order that represent the Row, Column, and Value of all of the elements making up the BINGO. The output should have the following format:

BINGO

R, C, V

R, C, V

...

Where:

R = row subscript from 1 to 5, and

C = column subscript from 1 to 5, and

V = called number value that matched the cell contents, or the word FREE.