eolymp
bolt
Try our new interface for solving problems
Məsələlər

In Braille

In Braille

The Braille system, designed by Louis Braille in 1825, revolutionized written communication for blind and visually impaired persons. Braille, a blind Frenchman, developed a tactile language where each element is represented by a cell with six dot positions, arranged in three rows and two columns. Each dot position can be raised or not, allowing for \textbf{64} di erent con gurations which can be felt by trained ngers. The gure below shows the Braille representation for the decimal digits (a black dot indicates a raised position). \includegraphics{https://static.e-olymp.com/content/14/14e6bbe1b93e121c3725c32370ec1205fcc086dc.jpg} In order to develop a new software system to help teachers to deal with blind or visual impaired students, a Braille dictionary module is necessary. Given a message, composed only by digits, your job is to translate it to or from Braille. Can you help? \InputFile Each test case is described using three or ve lines. The first line contains an integer \textbf{D} representing the number of digits in the message (\textbf{1} ≤ \textbf{D} ≤ \textbf{100}). The second line contains a single uppercase letter '\textbf{S}' or '\textbf{B}'. If the letter is '\textbf{S}', the next line contains a message composed of \textbf{D} decimal digits that your program must translate to Braille. If the letter is '\textbf{B}', the next three lines contain a message composed of \textbf{D} Braille cells that your program must translate from Braille. Braille cells are separated by single spaces. In each Braille cell a raised position is denoted by the character '\textbf{*}' (asterisk), while a not raised position is denoted by the character '\textbf{.}' (dot). The last test case is followed by a line containing one zero. \OutputFile For each test case print just the digits of the corresponding translation, in the same format as the input (see the examples for further clari cation).
Zaman məhdudiyyəti 1 saniyə
Yaddaşı istafadə məhdudiyyəti 64 MiB
Giriş verilənləri #1
10
S
1234567890
3
B
*. *. **
.. *. ..
.. .. ..
2
S
00
0
Çıxış verilənləri #1
*. *. ** ** *. ** ** *. .* .*
.. *. .. .* .* *. ** ** *. **
.. .. .. .. .. .. .. .. .. ..
123
.* .*
** **
.. ..
Mənbə ACM ICPC Latin America 2011, November 4th-5th, 2011