Skip to content

Latest commit

 

History

History
39 lines (24 loc) · 1.76 KB

MessageDecrypter.md

File metadata and controls

39 lines (24 loc) · 1.76 KB

Decrypt the Message (100 Marks)

Shubham and Ray are good friends and are always together. One fine day, the teacher divided the class into different teams and they both landed in separate teams. Teacher has provided them the puzzles to solve and told them that top 2 teams will get additional marks in the exams. Shubham's team has already won and there is race for the second spot. Ray's team is at last and has not solved any of the puzzle. The other teams are speeding up for the second spot.

Shubham wants Ray to be at second spot so he writes a message at a paper and gave it to Ray. They both have spent so much time together that Ray understands that Shubham wants the message to be decrypted and the formed decrypted message will be such that he will understand the answer to all puzzles. He also knows that the string will follow circular approach. Shubham did not provide the answer as teacher was keeping a check and wrote a message which was not suspicious. Now, Ray has message and needs your help to decrypt it as his team is running out of time. Help Ray secure the second spot.

Look for the example as Shubham is trying to help out while talking to people on how to decrypt the string. Also, he winked at Ray which means there will only be lower case letters.

Input Format The first line of input consist of number of test cases, T.

The first line of each test case consist of the message.

The second line of each test case consist of a numbered string which will help in decryption.

Constraints

1<= T <=10

1<= |string| <=100

1<= |numbered_string| <=|string|

Output Format

Print the decrypted message and help Ray secure second spot.

Sample TestCase 1

Input

2
fgjkl
23145
poliut
342561

Output

hdiog
msndas