uses crt;
var
har:array[1..5] of string;
i,n:integer;
begin
write('isminiz kac harfli');
readln(n);
for i:=1 to n do
begin
write(i, '. harfi girin');
readln(har[i]);
end;
for i:=1 to n do
begin
case har[i] of
'A':begin
write('##### ');
write('# # ');
write('##### ');
write('# # ');
write('# # ');
end;
'B':begin
write('#### ');
write('# # ');
write('#### ');
write('# # ');
write('#### ');
end;
'C':begin
write(' #### ');
write('# ');
write('# ');
write('# ');
write(' #### ');
end;
'D':begin
write('#### ');
write('# # ');
write('# # ');
write('# # ');
write('#### ');
end;
'E':begin
write('##### ');
write('# ');
write('##### ');
write('# ');
write('##### ');
end;
'F':begin
write('##### ');
write('# ');
write('#### ');
write('# ');
write('# ');
end;'G':begin
write(' ### ');
write('# ');
write('# ### ');
write('# # ');
write(' ### ');
end;'H':begin
write('# # ');
write('# # ');
write('##### ');
write('# # ');
write('# # ');
end;'I':begin
write('##### ');
write(' # ');
write(' # ');
write(' # ');
write('##### ');
end;'J':begin
write(' ### ');
write(' # ');
write(' # ');
write('# # ');
write(' ## ');
end;'K':begin
write('# # ');
write('# # ');
write('## ');
write('# # ');
write('# # ');
end;
'L':begin:
write('# ');
write('# ');
write('# ');
write('# ');
write('##### ');
end;
'M': begin
write('##### ');
write('# # # ');
write('# # # ');
write('# # ');
write('# # ');
end;
'N':begin
write('# # ');
write('## # ');
write('# # # ');
write('# ## ');
write('# # ');
end;
'O':begin
write(' ### ');
write('# # ');
write('# # ');
write('# # ');
write(' ### ');
write('
end;
'P':begin
write('#### ');
write('# # ');
write('#### ');
write('# ');
write('# ');
end;'R':begin
write('#### ');
write('# # ');
write('#### ');
write('# # ');
write('# # ');
end;
'S': begin
write('#### ');
write(' # ');
write('##### ');
write('# ');
write(' #### ');
end;
'T': begin
write('##### ');
write(' # ');
write(' # ');
write(' # ');
write(' # ');
end;
'U': begin
write('# # ');
write('# # ');
write('# # ');
write('# # ');
write(' ### ');
end;
'V': begin
write('# # ');
write('# # ');
write('# # ');
write(' # # ');
write(' # ');
end;
'Y': begin
write('# # ');
write(' # # ');
write(' # ');
write(' # ');
write(' # ');
write(' # ');
end;
'Z': begin
write('##### ');
write(' # ');
write(' # ');
write(' # ');
write('##### ');
end;
end;
end;
readln;
end.