#abc253e. [abc253_e]Distance Sequence
[abc253_e]Distance Sequence
Problem Statement
How many integer sequences of length satisfy all the conditions below?
Since the count can be enormous, find it modulo .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the count modulo .
Sample Input 1
2 3 1
Sample Output 1
6
The following sequences satisfy the conditions.
Sample Input 2
3 3 2
Sample Output 2
2
The following sequences satisfy the conditions.
Sample Input 3
100 1000 500
Sample Output 3
657064711
Print the count modulo .