Musical Scale

Given a sequence of played keys, decide whether all notes fit one major scale and print the earliest valid tonic, or desafinado.

Medium5ImplementationBrute forceMathNo attempts yetTime limit1sMemory limit1024 MB

Problem

Notes are the most basic units of Western music. Many people think there are only seven notes.

do re mi fa sol la si

Call these seven the elementary notes. There are more notes than these. The rest are usually written as one of the names above followed by a sharp sign (#).

do do# re re# mi fa fa# sol sol# la la# si

So there are twelve distinct basic notes. Strictly speaking the sequence is infinite and periodic: after a si comes another do, and the same order repeats.

The seven elementary notes are the familiar ones because they belong to the key of do major. In any major key, the distance between two neighbouring notes of the scale follows the same pattern. For do major:

Notedoremifasollasi
Interval to the next note2212221

Any do from any octave works in the do major scale, because the note after si is another do. The same holds for the other notes. Here is a second example, the scale of do# major:

Notedo#re#fafa#sol#la#do
Interval to the next note2212221

Guilherme is learning to play a keyboard with 61 keys, numbered 1 to 61. Key 1 is a do, key 2 is a do#, and so on until key 60, which is a si, and key 61, which is a do.

The pieces with the best melodies are said to be the ones written in some major key, that is, pieces where every note belongs to the scale of one major key. While he practises, Guilherme uses a device that records every note he plays. Write a program that decides whether a recorded piece is in some major key.

Input

The first line contains the number of notes in the piece, NN (1N1000001 \le N \le 100000).

Each of the next NN lines contains one played note, an integer between 11 and 6161 inclusive.

Output

If the piece is in some major key, print the name of that key's tonic on one line. Write the name without accents, using exactly one of do, do#, re, re#, mi, fa, fa#, sol, sol#, la, la#, si. If the piece is in no major key, print desafinado on one line.

If more than one major key is possible, print the one whose tonic comes first in the order do < do# < re < re# < mi < fa < fa# < sol < sol# < la < la# < si.