Problem: Given is a string S consisting of `0` and `1`. Find the number of strings, modulo 998244353, that can result from applying the following operation on S between 0 and K times (inclusive):

* Choose a pair of integers i, j (1\leq i < j\leq |S|) such that the i-th and j-th characters of S are `0` and `1`, respectively. Remove the j-th character from S and insert it to the immediate left of the i-th character.

Constraints

* 1 \leq |S| \leq 300
* 0 \leq K \leq 10^9
* S consists of `0` and `1`.

Input

Input is given from Standard Input in the following format:


S K


Output

Find the number of strings, modulo 998244353, that can result from applying the operation on S between 0 and K times (inclusive).

Examples

Input

0101 1


Output

4


Input

01100110 2


Output

14


Input

1101010010101101110111100011011111011000111101110101010010101010101 20


Output

113434815

Solution (in PYTHON3):

Solution:
def main():
    mod = 998244353
    s, k = input().split()
    k, n, o, cnt, z, zero_list = int(k), len(s), s.count("1")+1, 0, 0, []
    for i in range(n):
        if s[i] == "0":
            zero_list.append(cnt)
            cnt = 0
        else:
            cnt += 1
    m = min(o, k+1)

    dp = [[0]*m for _ in [0]*o]
    dp[0][0] = 1

    for i in zero_list:
        dp2 = [[0]*m for _ in [0]*o]
        dp3 = [[0] for _ in [0]*o]
        for x in range(o):
            t = 0
            for y in range(min(m, o-x)):
                t = (t+dp[x+y][y]) % mod
                dp3[x].append(t)
        dp4 = [[0]*m for _ in [0]*o]
        for y in range(m):
            t = dp[0][y]
            for x in range(1, o):
                dp4[x-1][y] = t
                t = (t+dp[x][y]) % mod
            dp4[o-1][y] = t
        for j in range(z+i, o):
            for x in range(min(j-i+1, m)):
                dp2[j][x] = (dp2[j][x]+dp3[j-x-i][min(o, x+1)]) % mod
            for p in range(m):
                dp2[j][p] = (dp2[j][p]+dp4[j][p]-dp4[max(j-i, p-1)][p]) % mod
        z += i
        dp = dp2
    print(sum([sum(i) for i in dp]) % mod)


main()