#include <iostream>
#include <string>

using namespace std;

void drawNote(char portativ[][255], int noteNr, int index, int sharp)
{
	int noteJ = 15 + noteNr * 5;

	portativ[10 - index][noteJ] = '@';
	portativ[10 - index][noteJ - 1] = '(';
	portativ[10 - index][noteJ + 1] = ')';

	if (sharp)
	{
		portativ[10 - index][noteJ - 2] = '#';
	}

	if (index < 6)
	{
		portativ[10 - index - 1][noteJ + 1] = '|';
		portativ[10 - index - 2][noteJ + 1] = '|';
		portativ[10 - index - 3][noteJ + 1] = '|';
	}
	else
	{
		portativ[10 - index + 1][noteJ - 1] = '|';
		portativ[10 - index + 2][noteJ - 1] = '|';
		portativ[10 - index + 3][noteJ - 1] = '|';
	}
}

int main()
{
	int n;

	char portativ[11][255];
	
	cin >> n;

	int nrcolumns = 15 + n * 5;

	for (int i = 0; i < 11; ++i)
	{
		for (int j = 0; j < nrcolumns; ++j)
		{
			portativ[i][j] = '-';
		}
	}

	strcpy(portativ[0], "----|-\\---");
	strcpy(portativ[1], "    |  }  ");
	strcpy(portativ[2], "----|-/---");
	strcpy(portativ[3], "    |/   4");
	strcpy(portativ[4], "---/|-----");
	strcpy(portativ[5], "  / |    4");
	strcpy(portativ[6], "-{--|-\\---");
	strcpy(portativ[7], "  \\_|_/   ");
	strcpy(portativ[8], "----|\\----");
	strcpy(portativ[9], "    |_}   ");
	strcpy(portativ[10], "          ");

	for (int i = 0; i < n; ++i)
	{
		string nota;
		int sharp = 0;
		cin >> nota;

		char index = nota[0] - 'C';
		if (nota.length() > 1 && nota[1] == '#')
		{
			sharp = 1;
		}

		if (nota == "C2")
		{
			index = 7;
		}
		else if (nota == "C2#")
		{
			index = 7;
			sharp = 1;
		}

		drawNote(portativ, i, index, sharp);
	}

	portativ[0][nrcolumns - 1] = '+';
	portativ[10][nrcolumns - 1] = '+';
	for (int i = 1; i < 10; ++i)
	{
		portativ[i][nrcolumns - 1] = '|';
	}

	return 0;
}