403363: GYM101138 K The World of Trains
Description
In the computer world, a train of the length n can be represented as an array A of the same length. Such an array A contains integer elements between 1 and k, inclusive. Each element in A represents the quality of one carriage. You can notice that there are exactly kn distinct trains.
Mike loves to travel and today he is going to do it with his friends. They want to occupy exactly d consecutive carriages. Of course, they want chosen d carriages to be of equal quality.
Someone saw a train and thus knows an array A. He said that there are exactly t ways for them to choose d consecutive carriages of equal quality. Now, Mike wants to know how many trains satisfy this description. Your task is to count them modulo 109 + 7.
InputThe only line of the input contains four integers n, d, t and k (1 ≤ d ≤ n ≤ 3333, 0 ≤ t ≤ n - d + 1, 1 ≤ k ≤ 109).
OutputFind the number of distinct trains fitting the given description, and print it modulo 109 + 7.
ExamplesInput5 2 1 2Output
8Input
3 2 2 5Output
5Input
3 2 0 5Output
80Note
For the first sample test the only possible arrays are:
- {1, 1, 2, 1, 2}
- {1, 2, 1, 1, 2}
- {1, 2, 1, 2, 2}
- {1, 2, 2, 1, 2}
- {2, 1, 1, 2, 1}
- {2, 1, 2, 1, 1}
- {2, 1, 2, 2, 1}
- {2, 2, 1, 2, 1}