#include <iostream>
	#include <cctype>
	#include <iterator>
	#include <algorithm>
	#include <vector>

	const std::vector<std::string> notes {"A", "A#", "B", "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#"};
	const std::vector<std::string> frets {"e", "B", "G", "D", "A", "E"};

	std::string nth_fret(const std::string& note, int N);
	std::string handle_column(const std::vector<std::string>& input, size_t& col);

	int main(int argc, char *argv[])
	{
		std::vector<std::string> input;
		for(size_t i = 0; i < 6; i++)
		{
			std::string line;
			getline(std::cin, line);
			input.push_back(line);
		}
		input[0][0] = 'e';
		for(size_t col = 2; col < input[0].length() - 1; col++)
		{
			std::string note = handle_column(input, col);
			if(note == "?")
				continue;
			std::cout << note << ' ';
		}
		std::cout << std::endl;
		return 0;
	}

	std::string handle_column(const std::vector<std::string>& input, size_t& col)
	{
		for(size_t row = 0; row < 6; row++)
		{
			if(isdigit(input[row][col]))
			{
				int N = input[row][col] - '0';
				if(col + 1 < input[0].length() - 1 && isdigit(input[row][col + 1])) //two digits
				{
					col++;
					N *= 10;
					N += input[row][col] - '0';
				}
				std::string note = nth_fret(frets[row] == "e" ? "E" : frets[row], N);
				return note;
			}
		}
		return "?";
	}

	std::string nth_fret(const std::string& note, int N)
	{
		size_t idx = N + std::distance(
			notes.begin(),
			std::find(notes.begin(), notes.end(), note)
		);
		idx %= notes.size();
		return notes[idx];
	}