You are given integers , and . You need to find the sum of integers , such that and, and have some common divisor excluding . Since this sum can be too large, print it modulo .
Input Format
The input is a single line containing space separated integers , and .
Output Format
Print a single intger equal to the required sum modulo .
Constraints
The values of which satisfy the given conditions for , and are . The sum of these numbers is equal to .