KLJUČ | 프로그래밍의 벗 PivotOJ
PivotOJ

KLJUČ

시간 제한: 1000ms메모리 제한: 128MB출처: CHC 2008 National Competition #2 - JuniorsBOJ 3129

문제

Marica is sending Mirko a secret message. In order to stop the evil witch from listening, Marica encrypts her message using a simple algorithm which uses an additional key. 

The message and the key are strings of letters in the English alphabet. The encryption method comprises several steps: 

  1. The key is cyclically repeated until it is of the same length as the message. 
  2. Each letter in the key and message is represented by a number between 0 and 25 (the letter 'a' is number 0; 'b' is 1 etc.). 
  3. Each letter in the message is added to the corresponding letter in the key (by adding their numeric values). If the result is 26 or more, we subtract 26 to make the result between 0 and 25. 
  4. The end result is represented as a string (0 for 'a', 1 for 'b' etc.). 

For example, if we encrypt the message "sutraujutro" with the key "abz", we get the result "svsrbtjvsrp". Here is the example in both string and numeric form: 

    s  u  t  r  a  u  j  u  t  r  o     18 20 19 17  0 20  9 20 19 17 14 
 +  a  b  z  a  b  z  a  b  z  a  b   +  0  1 25  0  1 25  0  1 25  0  1 
-------------------------------------------------------------------------
    s  v  s  r  b  t  j  v  s  r  p     18 21 18 17  1 19  9 21 18 17 15 

Unfortunately, the evil witch has learned the encryption method. Even though she doesn't know the key, she knows one part of the original message because she overheard it. That part of the messageis always at least twice as long as the key and appears in the message at least once, but the witch doesn't know where. 

Help the witch decrypt the message, catch Marica and Mirko and subsequently eat them. Write a program that, given the encrypted message and the known part of the original message, determines the original secret message. 

Note: the input data will be such that a solution will exist and will be unique.

입력

The first line contains the encrypted message, a string of at most 1000 lowercase letters (no spaces).

The second line contains the known part of the message, a string of at most 100 lowercase letters. 

출력

Output the secret message on a single line. 

예제

예제 1

입력
psinottfn
most
출력
primosten

예제 2

입력
svsrbtjvsrp
ujutro
출력
sutraujutro

예제 3

입력
yqyfjybckszapjezkqsqpok
vjesticu
출력
bacitcemovjesticuuvatru
코드를 제출하려면 로그인하세요.