提示: 欢迎访问OurACM平台。
Problem 1650 AB mod C

Accept: 627    Submit: 2605
Time Limit: 1000 mSec    Memory Limit : 32768 KB

Problem Description

Given A,B,C, You should quickly calculate the result of AB mod C.(1<=A,B,C<263).

Input

There are multiply testcases. Each testcase, there is one line contains three integers A, B and C, separated by a single space.

Output

For each testcase, output an integer, denotes the result of AB mod C.

Sample Input

3 2 4 2 10 1000

Sample Output

1 24

Source

FZU 2008 Summer Training III--Number Theory

Submit  Back  Status  Discuss