Practice on Toph

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

Some Basic Chords

By abdulhalimchy · Limits 1s, 512 MB

Where do you start when you want to learn to play guitar? Well learning chords and strumming songs is the first thing you want to work on.

The following ten beginner guitar chords are the most important first chords to learn. After you’ve memorized these guitar chords, you’ll have the all the technical knowledge you need to play thousands of songs.


x54321 ~~~~~~ 111111 110001 ~~~~~~

A-major


x54321 ~~~~~~ 111111 111101 ~~~~~~ 111111 110011 ~~~~~~

A-minor


xx4321 ~~~~~~ 111111 111110 ~~~~~~ 111111 111101 ~~~~~~ 111111 110011 ~~~~~~

B-minor


x54321 ~~~~~~ 111111 111101 ~~~~~~ 111111 110111 ~~~~~~ 111111 101111 ~~~~~~

C-major


xx4321 ~~~~~~ 111111 111110 ~~~~~~ 111111 111011 ~~~~~~ 111111 111101 ~~~~~~

D-minor


xx4321 ~~~~~~ 111111 111010 ~~~~~~ 111111 111101 ~~~~~~

D-major


654321 ~~~~~~ 111111 111011 ~~~~~~ 111111 100111 ~~~~~~

E-major


654321 ~~~~~~ 111111 100111 ~~~~~~

E-minor


x54321 ~~~~~~ 111111 111101 ~~~~~~ 111111 111011 ~~~~~~ 111111 100111 ~~~~~~

F-major


654321 ~~~~~~ 111111 101111 ~~~~~~ 111111 011100 ~~~~~~

G-major

 

Since, you are a programmer, your task is not to play guitar. Your task is write a program to identify the input chord.

Input

The first line of input contains the integer T (1 ≤ T ≤ 10), the number of test cases. Each case starts with an integer N (5 ≤ N ≤11), the number of strings are needed to form a chord. Next N lines will contain N strings and these will form a chord.

Output

You program should output exactly T lines. Identify the input chord and print it. Each line should be the form of ‘Case X: Chord’ , where ‘X’ is the case number and ‘Chord’ is the name of the chord.

Sample

InputOutput
2
5
x54321
~~~~~~
111111
110001
~~~~~~
8
x54321
~~~~~~
111111
111101
~~~~~~
111111
110011
~~~~~~
Case 1: A-major
Case 2: A-minor

Note: It is guaranteed that there is no input chord except the chords are mentioned above.


Problem Setter: Abdul Halim Chowdhury

Discussion
Statistics

98% Solution Ratio

aaman007Earliest, Jul '17

muzahid.islamFastest, 0.0s

SIR.24Lightest, 0 B

mdvirusShortest, 602B

Submit

Login to submit