Staff

After numerous failed attempts at impressing Xoranna, the girl of his dreams, Xorin made a desperate leap of faith: he turned to the cheerful-sounding heart-stealing super-dandy-relaxed power of smooth jazz. Having bought a shiny new saxophone and his favourite songbook, Duke Silver's Jazz it up a little, Xorin encountered one unexpected problem. Due to sheer greed, the book's editors decided to simplify the musical notation, in order to cut down on printing costs.

This is where you come in. Xorin has no time to learn this new-age revolutionary musical notation, so you have to transcribe any song to the only format he knows: using a staff.

Input

You are given one song, in the following manner:

  • first line of input: an integer n, equal to the number of notes in the song;
  • the following n lines of input: one note on each line.

The song is in the C Major scale, so the set of all possible unaltered notes is {C, D, E, F, G, A, B, C2}. Moreover, some notes may be followed by a #, which makes them sharp. Xorin knows that E# == F, and also B# == C2. Therefore, it is guaranteed that no E# or B# notes will ever be found in the input (F and C2 will be used instead).

Output

You need to construct a musical staff which contains the same sequence of notes as the input. The staff endorses the following structure:

----|-\-----------------------------------------------------------------------------+
    |  }                                                                            |
----|-/-----------------------------------------------------|----|------------------|
    |/   4                                        |    |    |    |       (@) #(@)   |
---/|-----------------------------------|----|----|----|----|----|--(@)--|----|-----|
  / |    4                         |    |    |    |    |  (@) #(@)  |    |    |     |
-{--|-\------------------|----|----|----|----|--(@)-#(@)------------|----|----|-----|
  \_|_/        |    |    |    |    |  (@) #(@)                      |               |
----|\---------|----|----|----|--(@)------------------------------------------------+
    |_}        |    |  (@) #(@)                                                      
             (@) #(@)                                                                

This example contains all possible input notes, in ascending order: C, C#, D, D#, E, F, F#, G, G#, A, A#, B, C2, C2#.

Let us identify the position of a note by the column on which its @ lies.
The treble clef's position is the column on which its vertical line lies.
The measure is always 4/4, and its position is also the column on which both digits lie.

The staff should be constructed in the following order: firstly, it should contain the treble clef, followed by the measure, which should itself be followed by the sequence of notes. The staff always ends with a vertical bar, as seen in the example above. All elements must be placed on consecutive positions, that can be evenly divided by 5.
For clarification, check the positions used in the example - clef: 5, measure: 10, notes: 15, 20, ..., 80, final bar: 85.

Constraints

  • Xoranna has got a lot of admirers to deal with (and not much time on her hands), therefore the song that Xorin chooses to play for her will never be longer than 250 notes. The song might even contain no notes at all!

Samples

InputOutput
3
D#
C2#
A
----|-\----------------------+
    |  }                     |
----|-/------------------|---|
    |/   4       #(@)    |   |
---/|-------------|------|---|
  / |    4        |    (@)   |
-{--|-\--------|--|----------|
  \_|_/        |             |
----|\---------|-------------+
    |_}     #(@)              
                              
5
G
B
F#
C
F#
----|-\--------------------------------+
    |  }                               |
----|-/--------------------------------|
    |/   4     |                       |
---/|----------|--(@)----|---------|---|
  / |    4     |  |      |         |   |
-{--|-\------(@)--|------|---------|---|
  \_|_/           |   #(@)    | #(@)   |
----|\------------------------|--------+
    |_}                       |         
                            (@)         
Questions?

Sponsors Gold