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:
s,k = input().split()
mod = 998244353
k = int(k)
k = min(300,k)
raw = [0]
l = len(s)
for i in range(l):
  if s[i] == '0':
    raw.append(0)
  else:
    raw[-1] += 1
#print(raw)
now = [[0 for _ in range(k+1)] for _ in range(k+1)]
l = len(raw)
raw.reverse()
#print(raw)
now[0][0] = 1
for x in raw:
  last = now[:]
  now = []
  for i in range(k+1):
    use = last[i][:]
    use.reverse()
    cum = []
    for j in range(k+1):
      if cum:
        cum.append(cum[-1]+use[j])
        cum[-1] %= mod
      else:
        cum = [use[0]]
    cum.reverse()
    now.append(cum)
    #print(cum)
  #print('#')
  cum2 = []
  for i in range(k+1):
    cum = [0 for _ in range(i)]
    cum.append(last[i][0])
    #print('%',cum)
    for l in range(i+1,k+1):
      cum.append(cum[-1]+last[l][l-i])
    #print(cum)
    cum2.append(cum)
  for i in range(k+1):
    for j in range(k+1):
      if j > i:
        pass
      now[i][j] += cum2[i-j][i]
      if i - x - 1 >= 0:
        now[i][j] -= cum2[i-j][i-x-1]
      now[i][j] %= mod
  for i in range(k+1):
    for j in range(k+1):
      now[i][j] -= last[i][j]
      now[i][j] %= mod
  #print(now)
  #print('##')
        
  #print(now)
#print(now)
ans = 0
for i in range(k+1):
  ans += now[i][0]
print(ans%mod)