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


#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <string>
using namespace std;

const int STAFF_SIZE = 11;
string staff[STAFF_SIZE] = {
    "----|-\\----",
    "    |  }   ",
    "----|-/----",
    "    |/   4 ",
    "---/|------",
    "  / |    4 ",
    "-{--|-\\----",
    "  \\_|_/    ",
    "----|\\-----",
    "    |_}    ",
    "           "
};

void play(int note, bool sharp) {
    int atPos = STAFF_SIZE - note - 1;
    string atPart = "  (@)";
    if (sharp) atPart[1] = '#';
    if (atPos % 2 == 0 && atPos < 10) atPart[0] = '-';

    staff[atPos] += atPart;

    for (int l = 0; l < STAFF_SIZE; l += 1) {
        if (l == atPos) continue;

        string natPart;
        if (l % 2 == 0 && l < 10) {
            natPart = "-----";
        } else {
            natPart = "     ";
        }

        if (note < 6 && l < atPos && atPos - l <= 3) {
            natPart[4] = '|';
        }

        if (note >= 6 && l > atPos && l - atPos <= 3) {
            natPart[2] = '|';
        }
        staff[l] += natPart;
    }
}

int main() {
    int n;
    cin >> n;
    for (int i = 1; i <= n; i += 1) {
        string note;
        cin >> note;

        int notePos;
        bool isSharp = false;

        notePos = (note[0] == 'C') ? 0 :
                  (note[0] == 'D') ? 1 :
                  (note[0] == 'E') ? 2 :
                  (note[0] == 'F') ? 3 :
                  (note[0] == 'G') ? 4 :
                  (note[0] == 'A') ? 5 :
                  (note[0] == 'B') ? 6 :
                  666;

        if (note.size() > 1 && note[1] == '2') {
            notePos = 7;
        }

        if (note[note.size() - 1] == '#') {
            isSharp = true;        
        }
        play(notePos, isSharp);
    }

    for (int l = 0; l < STAFF_SIZE; l += 1) {
        string natPart;
        if (l > 8) {
            natPart = "    ";
        } else {
            if (l % 2 == 0) {
                natPart = "---|";
            } else {
                natPart = "   |";
            }
            if (l == 0 || l == 8) {
                natPart[3] = '+';
            }
        }
        staff[l] += natPart;

        cout << staff[l] << '\n';
    }
    return 0;
}