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:
sk = input().split()
s = sk[0]
K = int(sk[1])
mod = 998244353

x = [0]
for si in s:
    if(si=='0'):
        x.append(0)
    else:
        x[-1] += 1

while(x):
    if(x[-1] == 0):
        x.pop()
    else:
        break
x = x[::-1]
len_x = len(x)
ones = min(K,sum(x))
dp = [[] for _ in range(len_x+1)]

for i in range(len_x+1):
    dp[i] = [[0] * (ones+1) for _ in range(ones+1)]

dp[0][0][0] = 1
for i,xi in enumerate(x):
    cumsum_y = [[0] * (ones+2) for _ in range(ones+2)]
    cumsum_xy = [[0] * (ones+2) for _ in range(ones+2)]

    for j in range(ones+1):
        for k in range(ones+1):
            cumsum_y[j+1][k+1] = (cumsum_y[j][k+1] + dp[i][j][k])%mod
            cumsum_xy[j+1][k+1] = (cumsum_xy[j][k] + dp[i][j][k])%mod

    for j in range(ones+1):
        for k in range(j,ones+1):
            dp[i+1][j][k] += cumsum_y[k+1][k+1] - cumsum_y[j][k+1]
            dp[i+1][j][k] += cumsum_xy[j][k] - cumsum_xy[max(0,j-xi)][max(0,j-xi) + k-j]
            dp[i+1][j][k] %= mod

ans = 0
for k in range(ones+1):
    ans += dp[-1][0][k]
    ans %= mod

print(ans)