C - AMGINE

You have been hired by a certain organization to snoop on the Internet traffic, particularly encrypted e-mail messages from hostile countries. It is assumed that the enemy is transmitting map coordinates via encrypted e-mail. You job is to decrypt the messages and produce the original coordinates, which are integers in the range [0, 32000).

Luckily, intelligence has obtained the encryption algorithm! The algorithm takes the original coordinate (one integer), P, and applies the following formula to obtain the encrypted number, C:

The '%' sign is the "remainder after division" operator. For this problem, it works as expected in both C/C++ and Java.

Input

The input will consist of a sequence of integers (encrypted coordinates). Every pair of consecutive numbers will be separated by one or more spaces, tabs ('\t') or new lines ('\n'). The input is terminated by the end of file.

Output

Output one number (the decrypted coordinate) for each input number. Every number your program prints must be on a separate line by itself with no leading or trailing characters.

Sample input

10000  154878024
26337421
216854990

Sample output

0
1
3
31999