#ifdef ONLINE_JUDGE
#include <bits/stdc++.h>
#else
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <cstdlib>
#endif

using namespace std;

	// lambda : [] (int a, int b) -> bool { body return }
	// string r_str = R"(raw string)"

#define mp make_pair
#define eb emplace_back
#define pb push_back
#define LL long long
#define ULL unsigned long long
#define BASE 73
#define NMAX 90000
#define NMAX2 20001
#define MOD1 9000000007
#define ALL(V) (V).begin(), (V).end()
#define ALLR(V) (V).rbegin(), (V).rend()
#define CRLINE Duxar(__LINE__);
#define SHOWME(x) cerr << __LINE__ << ": " << #x << " = " << (x) << endl;
#define ENTER putchar('\n');

void Duxar(int _this_line) {
#ifndef ONLINE_JUDGE
	printf("\n . . . . . . . . . . . . . Passed line - %d\n", _this_line);
#endif
}

template <class T>
void ReadNo(T &_value) {
	T sign = 1;
	char ch;
	_value = 0;
	while(!isdigit(ch = getchar())) {
		(ch == '-') && (sign = -1);
	}
	do {
		_value = _value * 10 + (ch - '0');
	} while(isdigit(ch = getchar()));
	_value *= sign;
}

template <class T>
void AddNr(T &a, T b) {
	a = a + b;
	while (a >= MOD1) {
		a -= MOD1;
	}
	while (a < 0) {
		a += MOD1;
	}
}

char mat[11][90002];
int N;

void AddKey() {
	strcpy (mat[0],"----|-\\-----"); mat[0][12] = '-';
	strcpy (mat[1],"    |  }    "); mat[1][12] = ' ';
	strcpy (mat[2],"----|-/-----"); mat[2][12] = '-';
	strcpy (mat[3],"    |/   4  "); mat[3][12] = ' ';
	strcpy (mat[4],"---/|-------"); mat[4][12] = '-';
	strcpy (mat[5],"  / |    4  "); mat[5][12] = ' ';
	strcpy (mat[6],"-{--|-\\-----"); mat[6][12] = '-';
	strcpy (mat[7],"  \\_|_/     "); mat[7][12] = ' ';
	strcpy (mat[8],"----|\\------"); mat[8][12] = '-';
	strcpy (mat[9],"    |_}     "); mat[9][12] = ' ';
}

void MakeNote(int line, int col, bool sharp) {
	if (sharp) {
		mat[line][col] = '#';
	}
	strcpy((mat[line] + col + 1), "(@)");
	mat[line][col + 4] = mat[line][col + 5];
	for (int i = line - 1; i > line - 4; --i) {
		mat[i][col + 3] = '|';
	}
}

void MakeNoteRev(int line, int col, bool sharp) {
	if (sharp) {
		mat[line][col] = '#';
	}
	strcpy((mat[line] + col + 1), "(@)");
	mat[line][col + 4] = mat[line][col + 5];
	for (int i = line + 1; i < line + 4; ++i) {
		mat[i][col + 1] = '|';
	}
}

void MakeEnd(int col) {
	mat[0][col] = '+';
	mat[0][col + 1] = 0;
	mat[8][col] = '+';
	mat[8][col + 1] = 0;
	for (int i = 1; i < 8; ++i) {
		mat[i][col] = '|';
		mat[i][col + 1] = 0;
	}
	mat[8][col + 1] = mat[9][col + 1] = mat[10][col + 1] = 0;
}

int main(){
#ifndef ONLINE_JUDGE
			freopen("input.cpp", "r", stdin);
#endif
	
	string note;
	int i, line, col = 12;
	ReadNo(N);
	
	fill(mat[0], mat[0] + 90000, '-');
	fill(mat[1], mat[1] + 90000, ' ');
	fill(mat[2], mat[2] + 90000, '-');
	fill(mat[3], mat[3] + 90000, ' ');
	fill(mat[4], mat[4] + 90000, '-');
	fill(mat[5], mat[5] + 90000, ' ');
	fill(mat[6], mat[6] + 90000, '-');
	fill(mat[7], mat[7] + 90000, ' ');
	fill(mat[8], mat[8] + 90000, '-');
	fill(mat[9], mat[9] + 90000, ' ');
	fill(mat[10], mat[10] + 90000, ' ');
	
	AddKey();
	for (i = 0; i < N; ++i, col += 5) {
		cin >> note;
		if (note == "C") {
			MakeNote(10, col, 0);
		}
		else if (note == "C#") {
			MakeNote(10, col, 1);
		}
		else if (note == "D") {
			MakeNote(9, col, 0);
		}
		else if (note == "D#") {
			MakeNote(9, col, 1);
		}
		else if (note == "E") {
			MakeNote(8, col, 0);
		}
		else if (note == "F") {
			MakeNote(7, col, 0);
		}
		else if (note == "F#") {
			MakeNote(7, col, 1);
		}
		else if (note == "G") {
			MakeNote(6, col, 0);
		}
		else if (note == "G#") {
			MakeNote(6, col, 1);
		}
		else if (note == "A") {
			MakeNote(5, col, 0);
		}
		else if (note == "A#") {
			MakeNote(5, col, 1);
		}
		else if (note == "B") {
			MakeNoteRev(4, col, 0);
		}
		else if (note == "C2") {
			MakeNoteRev(3, col, 0);
		}
		else if (note == "C2#") {
			MakeNoteRev(3, col, 1);
		}
	}
	col += 2;
	if (N == 0) col = 9;
	MakeEnd(col);
	
	for (i = 0; i < 10; ++i) {
		cout << mat[i] << '\n';
	}
	cout << mat[10];
	
	return 0;
}