You are given three integers $$$k$$$, $$$p$$$, $$$x$$$. Find the number of integer pairs $$$(a,b)$$$ that satisfy the following conditions:
The only line of the input contains three integers: $$$k$$$ ($$$1\le k\le 2^{1000}$$$), $$$p$$$ ($$$2\le p\le 5000$$$) and $$$x$$$ ($$$1\le x \lt p$$$).
The integer $$$k$$$ is given in its binary form, starting from the highest bit.
It is guaranteed that $$$p$$$ is prime and that the first digit of $$$k$$$ in the input is $$$1$$$.
Output a single integer – the answer modulo $$$998244353$$$.
1 7 5
2
1 43 17
17
1111111111 4999 1954
195378837