Подразделы

Другие разделы

Дата и время

17/11/2024 01:16:13

Авторизация

Имя:
Пароль:
Зарегистрироваться
Восстановить пароль
 

printMetamorphoses

Ограничения: время – 250ms/500ms, память – 64MiB Ввод: input.txt или стандартный ввод Вывод: output.txt или стандартный вывод copy
Послать решение Blockly Посылки Темы Где Обсудить (0)

Take two words of equal length, for example, SEAT and TALE, write them one under another and make the following transformations. At first, replace all appearances of the first character of the second word in the second word with the first character of the first word, and all appearances of the first character of the first word in the first word with the first character of the second word. Similarly, all appearances of the second character of the second word in the second word with the second character of the first word, and all appearances of the second character of the first word with the first word on the second character of the second word. The same must be done for the third pair of characters of the both words, and so on for all characters from left to right.
SEAT TEAT TAAT TLLT ELLE
TALE SALE SELE SEAE STAT

Write the program, which calculates outcome of transformations for the pair of the given words.
Input
Input file contains two lines. Each line contains one word, the length of which is not more than 100 characters consisting of uppercase letters from A through Z. Both words have equal length.
Output
Write into the output file two lines containing the outcome of transformations. On the first line write the transformed first word, and on the second line write the transformed second word.

Sample Input

SEAT
TALE

Sample Output

ELLE
STAT
Условие задачи на русском языке
loading