Rachel and Phoebe are sick of Ross trying to teach them the importance of UNAGI and decide to give him a problem to keep him busy . Ross asks for your help to solve the problem :
You are given Q queries containing two integers a,b . Your task is simple.
Calculate sum of prime factors of
(abc + 1)%m where m is 106+3
Input :
First line contains single integer Q .
Next Q lines contain three spaced integers a,b,c.
Output :
For each query output the answer in a new line.
Constraints :
1≤Q≤106
0≤a,b≤109
0≤c≤1018
Problem Setter - Vaibhav Bansal