#include <iostream>
#include <map>
#include <string>
#include <tuple>

using namespace std;

int main()
{
    string staff [] =
    {
        R"(----|-\---)",
        R"(    |  }  )",
        R"(----|-/---)",
        R"(    |/   4)",
        R"(---/|-----)",
        R"(  / |    4)",
        R"(-{--|-\---)",
        R"(  \_|_/   )",
        R"(----|\----)",
        R"(    |_}   )",
        R"(          )"
    };

    int n;
    cin >> n;

    string dashes(n * 5, '-');
    string spaces(n * 5, ' ');

    for (int i = 0; i < 11; i++)
    {
        staff[i].reserve(15 + n * 5);

        if (i % 2 == 0 && i < 9)
            staff[i] += dashes;
        else
            staff[i] += spaces;

        if (i == 0 || i == 8)
            staff[i] += "----+";
        else if (i == 2 || i == 4 || i == 6)
            staff[i] += "----|";
        else if (i < 9)
            staff[i] += "    |";
    }

    map<string, tuple<int, bool>> note_map =
    {
        { "C", make_tuple(10, false) },
        { "C#", make_tuple(10, true) },
        { "D", make_tuple(9, false) },
        { "D#", make_tuple(9, true) },
        { "E", make_tuple(8, false) },
        { "E#", make_tuple(7, false) },
        { "F", make_tuple(7, false) },
        { "F#", make_tuple(7, true) },
        { "G", make_tuple(6, false) },
        { "G#", make_tuple(6, true) },
        { "A", make_tuple(5, false) },
        { "A#", make_tuple(5, true) },
        { "B", make_tuple(4, false) },
        { "B#", make_tuple(3, false) },
        { "C2", make_tuple(3, false) },
        { "C2#", make_tuple(3, true) }
    };

    for (int i = 0; i < n; i++)
    {
        string s;
        cin >> s;
        const auto &note = note_map[s];
        auto col = 14 + i * 5;
        auto pos = get<0>(note);
        auto sharp = get<1>(note);
        auto dir = (pos > 4) ? -1 : 1;

        staff[pos][col] = '@';
        staff[pos][col - 1] = '(';
        staff[pos][col + 1] = ')';
        staff[pos + dir][col - dir] = '|';
        staff[pos + dir * 2][col - dir] = '|';
        staff[pos + dir * 3][col - dir] = '|';
        
        if (sharp)
            staff[pos][col - 2] = '#';
    }


    for (const auto &line : staff)
    {
        cout << line << '\n';
    }
}