#jag2018summerday2a. [jag2018summer_day2_a]10^N+7

[jag2018summer_day2_a]10^N+7

Problem Statement

You are given three non-negative integers, xx, yy, zz. Your task is to find the smallest non-negative integer nn with all of the following conditions:

  • nrmmod17=xn\\ {\\rm mod}\\ 17 = x
  • nrmmod107=yn\\ {\\rm mod}\\ 107 = y
  • nrmmod1000000007(=109+7)=zn\\ {\\rm mod}\\ 1000000007(=10^9+7) = z

Constraints

  • 0leqx<170 \\leq x < 17
  • 0leqy<1070 \\leq y < 107
  • 0leqz<109+70 \\leq z < 10^9+7

Input

The input is given from Standard Input in the following format:

xx yy zz

Output

Print the value of nn in the statement.


Sample Input 1

15 50 1

Sample Output 1

1000000008

Sample Input 2

0 0 0

Sample Output 2

0

Sample Input 3

3 14 159265358

Sample Output 3

1050159272708