Module: Workshop on RSA


Problem

1 /1


RSA: Decryption

Problem

Two prime numbers p and q are given. It is necessary to decrypt a message consisting of a sequence of numbers ending in zero using the RSA algorithm.

Input
The first line contains p and q (\(3<=p,q<10\)), then a message is entered consisting of natural numbers, each not exceeding 100. The message ends with zero.

Imprint
Print the decrypted message.
 

 

Examples
# Input Output
1 3 7
1 11 12 0
123