#1514. Rhyme
Rhyme
Description
We call a sequence good iff and for all , the occurrences of in is a multiple of . Please count the number of good sequences. Since the answer could be extremely large, you just need to calculate it modulo .
Input Format
One line with three positive integers .
Output Format
Output one integer which is the answer modulo .
Example 1
8 3 4
213
12 4 6
5548
Limits
For of the testcases, .
For the rest of the testcases, .
It's guaranteed that .