#include <fstream>
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#include <stack>

#define DIM 100
#define vint vector<int>))iterator
#define pint vector< pair<int, int> >))iterator
#define sint set<int>))iterator
#define infile "test.in"
#define outfile "test.out"

using namespace std;

int n;

int v[10000];

char s[12][100] = {
	("----|-\-----------------------------------------------------------------------------+"),
	("    |  }                                                                            |"),
	("----|-/-----------------------------------------------------|----|------------------|"),
	("    |/   4                                        |    |    |    |       (@) #(@)   |"),
	("---/|-----------------------------------|----|----|----|----|----|--(@)--|----|-----|"),
	("  / |    4                         |    |    |    |    |  (@) #(@)  |    |    |     |"),
	("-{--|-\------------------|----|----|----|----|--(@)-#(@)------------|----|----|-----|"),
	("  \_|_/        |    |    |    |    |  (@) #(@)                      |               |"),
	("----|\---------|----|----|----|--(@)------------------------------------------------+"),
	("    |_}        |    |  (@) #(@)                                                      "),
	("             (@) #(@)                                                                ")

};

int start[16] = {0, 11, 16, 21, 26, 31, 36, 41, 46, 51, 56, 61, 66, 71, 76, 81};

int endd[16] =  {10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 84};

int main() {

#ifndef ONLINE_JUDGE

	freopen(infile, "r", stdin);
	freopen(outfile, "w", stdout);


#endif

	char st[20];

	cin >> n;

	for (int i = 1; i <= n; ++i) {

		cin >> st;

		//switch (st) {

		if (strcmp(st, "C") == 0)
			v[i] = 1;
		if (strcmp(st, "C#") == 0)
			v[i] = 2; 
		if (strcmp(st, "D") == 0)
			v[i] = 3; 
		if (strcmp(st, "D#") == 0)
			v[i] = 4; 
		if (strcmp(st, "E") == 0)
			v[i] = 5; 
		if (strcmp(st, "F") == 0)
			v[i] = 6; 
		if (strcmp(st, "F#") == 0)
			v[i] = 7; 
		if (strcmp(st, "G") == 0)
			v[i] = 8; 
		if (strcmp(st, "G#") == 0)
			v[i] = 9; 
		if (strcmp(st, "A") == 0)
			v[i] = 10; 
		if (strcmp(st, "A#") == 0)
			v[i] = 11; 
		if (strcmp(st, "B") == 0)
			v[i] = 12; 
		if (strcmp(st, "C2") == 0)
			v[i] = 13; 
		if (strcmp(st, "C2#") == 0)
			v[i] = 14; 
	//	}


	}

	for (int i = 0; i < 11; ++i) {

		for (int j = start[0]; j <= endd[0]; ++j)
			cout << s[i][j];

		for (int k = 1; k <= n; ++k) {

			for (int j = start[v[k]]; j <= endd[v[k]]; ++j)
				cout << s[i][j];

		}

		for (int j = 81; j <= 84; ++j)
			cout << s[i][j];

		cout << '\n';

	}
	

	
	return 0;
}

//Trust me, I'm the Doctor!