Cards

No attempts yetTime limit2sMemory limit512 MB

Statement

Alice and Bob found several decks of cards in the attic. Some were dusty, some were incomplete, and some held unusual honor cards that a regular deck does not contain. Even so, every card shared one trait: it was either black or red.

Being creative children, they decided to use all the cards they had found and play the following game.

First they shuffle every card together. Then they reveal the cards one at a time from the top of the deck onto the table. Alice wins if the very first revealed card is black, or if some maximal run of consecutively revealed black cards is not immediately preceded by a run of consecutive red cards whose length is at least kk times the length of that black run. Otherwise, once all cards have been revealed, Bob wins.

Alice wants to know her chances, so she asks: over all arrangements of the deck that a shuffle could produce, in how many of them does she win? Cards of the same color are indistinguishable. Because Alice just learned the Chinese remainder theorem, it is enough to report the answer modulo a given prime number pp.

Input

The only line of input contains four integers rr, bb, kk, and pp (1r,b1000001 \le r, b \le 100\,000, 1k101 \le k \le 10, 2p10000000002 \le p \le 1\,000\,000\,000), separated by single spaces. Here rr is the number of red cards, bb is the number of black cards, and pp is a prime number.

Output

Print a single integer: the number of arrangements of rr red cards and bb black cards in which Alice wins, taken modulo pp.

Hint

Consider r=4r = 4, b=2b = 2, k=1k = 1. Writing R for a red card and B for a black card (the leftmost letter is the card on top of the deck), Alice wins for exactly these arrangements: BBRRRR, BRBRRR, BRRBRR, BRRRBR, BRRRRB, and RBBRRR. In each of them either the first card is black, or a run of black cards is immediately preceded by a run of red cards shorter than that black run.