CSCI 499 Sp18 Set I

#### Start

2018-01-11 08:00 CET

## CSCI 499 Sp18 Set I

#### End

2018-01-17 23:00 CET
The end is near!
Contest is over.
Not yet started.
Contest is starting in -256 days 19:45:08

159:00:00

0:00:00

# Problem FPreludes

Frederic Chopin was a Polish music composer who lived from 1810–1849. One of his most famous works was his set of preludes. These $24$ pieces span the $24$ musical keys (there are musically distinct $12$ scale notes, and each may use major or minor tonality). The $12$ distinct scale notes are:

$\begin{array}{|*{12}{c|}} \hline 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 \\ A & A\sharp = B\flat & B & C & C\sharp = D\flat & D & D\sharp = E\flat & E & F & F\sharp = G\flat & G & G\sharp = A\flat \\ \end{array}$

Five of the notes have two alternate names, as is indicated above with the equals sign (e.g. $C\sharp = D\flat$ means that note has two names, $C\sharp$ and $D\flat$). Thus, there are $17$ possible names for the scale notes, but only $12$ musically distinct notes. When using one of these as the keynote for a musical key, we can further distinguish between the major and minor tonalities. This gives $34$ possible keys, of which $24$ are musically distinct.

In naming his preludes, Chopin used all the keys except for the following $10$ (which were named instead by their alternate names):

$\begin{array}{*{5}{c}} A\flat \text { minor} & A\sharp \text { major} & A\sharp \text { minor} & C\sharp \text { major} & D\flat \text { minor} \\ D\sharp \text { major} & D\sharp \text { minor} & G\flat \text { major} & G\flat \text { minor} & G\sharp \text { major} \end{array}$

Write a program that, given the name of a key, will give an alternate name (if it has an alternate) or report that the key name is unique.

## Input

Each input line contains one test case. There are at least one and at most five cases, and the end of input is at the end of file. Each line has the format “note tonality”, where note is one of the $17$ names for the scale notes given above, and tonality is either major or minor. All note names will be upper-case, and the two accidentals ($\sharp$ and $\flat$) will be written as # and b, respectively.

## Output

For each case, output ‘Case X:’ (where X is the case number starting at $1$), followed by a space. Then output the alternate key name, if it exists, or print UNIQUE if the key name is unique.

Sample Input 1 Sample Output 1
Ab minor
D# major
G minor

Case 1: G# minor
Case 2: Eb major
Case 3: UNIQUE