#include <iostream>
#include <vector>
#include <cstring>
#include <bitset>
#include <set>
#include <deque>
#include <queue>
#include <iomanip>
#include <map>
#include <algorithm>
#include <cmath>
#include <stack>
#include <sstream>
#include <functional>
#include <utility>
#include <cstdio>

using namespace std;

#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define int64 unsigned long long

char a[20][340];

void open(){
    for(int i = 1; i <= 10; i++)
        a[i][5] = '|';
    a[1][7] = a[8][3] = a[7][7] = a[9][6] = '\\';
    a[2][8] = a[10][7] = '}';
    a[7][2] = '{';
    a[8][4] = a[8][6] = a[10][6] = '_';
    a[3][7] = a[4][6] = a[5][4] = a[6][3] = a[8][7] = '/';
    a[4][10] = a[6][10] = '4';
}

void put_note(int pos,int line,int up){
    a[line][pos] = '(';
    a[line][pos+1] = '@';
    a[line][pos+2] = ')';
    if(up == 0){
        a[line+1][pos] = '|';
        a[line+2][pos] = '|';
        a[line+3][pos] = '|';
    }
    else{
        a[line-1][pos+2] = '|';
        a[line-2][pos+2] = '|';
        a[line-3][pos+2] = '|';
    }
}

int main(){

    ios_base::sync_with_stdio(false);

    for(int i = 1; i <= 9; i+=2){
        for(int j = 1;j <= 300; j++)
            a[i][j] = '-';
    }

    open();

    int n;
    cin >> n;

    int next = 13;
    for(int i = 1; i <= n; i++){
        string s;
        cin >> s;
        if(s == "C" || s == "C#"){
            if(s == "C#")
                a[11][next] = '#';
            next++;
            put_note(next,11,1);
            next = next + 4;
        }

        if(s == "D" || s == "D#"){
            if(s == "D#")
                a[10][next] = '#';
            next++;
            put_note(next,10,1);
            next += 4;
        }

        if(s == "E"){
            //if(s == "D#")
              //  a[10][next] = '#',next++;
            next++;
            put_note(next,9,1);
            next += 4;
        }

        if(s == "F" || s == "F#"){
            if(s == "F#")
                a[8][next] = '#';
            next++;
            put_note(next,8,1);
            next += 4;
        }

        if(s == "G" || s == "G#"){
            if(s == "G#")
                a[7][next] = '#';
            next++;
            put_note(next,7,1);
            next += 4;
        }

        if(s == "A" || s == "A#"){
            if(s == "A#")
                a[6][next] = '#';
            next++;
            put_note(next,6,1);
            next += 4;
        }

        if(s == "B"){
            //if(s == "D#")
              //  a[6][next] = '#',next++;
              next++;
            put_note(next,5,0);
            next += 4;
        }


        if(s == "C2" || s == "C2#"){
            if(s == "C2##")
                a[4][next] = '#';
            next++;
            put_note(next,4,0);
            next += 4;
        }
    }

    next += 2;

    if(n == 0)
        return 0;

    a[1][next] = '+';
    a[9][next] = '+';
    for(int i = 2; i < 9; i++){
        a[i][next] = '|';
    }

    for(int i = 1; i <= 11; i++){
        for(int j = 1; j <= next; j++)
            cout << a[i][j];
        cout << "\n";
    }
}