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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int md=998244353;
struct Modint {
  int x;
  Modint() { x=0; }
  Modint operator+=(const Modint& oth) {
    x+=oth.x;
	if (x>=md) x-=md;
	return *this;
  }
} f[302][302][302][4],r;
int n,m,i,j,k1,lst,cur,s0,s1;
char s[302];
int main() {
  scanf("%s",s);  n=strlen(s);
  scanf("%d",&m); m=min(m,n);
  f[0][0][0][0].x=1;
  for (i=0; i<n; i++) {
    cur=s[i]-'0';
	for (j=0; j<=m; j++) for (k1=0; k1<=j; k1++) for (lst=0; lst<4; lst++) if (f[i][j][k1][lst].x) {
	  if (cur==0) {
	    f[i+1][j][k1][0]+=f[i][j][k1][lst];
		if (lst<2) f[i][j+1][k1+1][1]+=f[i][j][k1][lst];
	  } else {
	    f[i+1][j][k1][(lst/2)*2+1]+=f[i][j][k1][lst];
		if (k1>0 && lst%2==0) f[i+1][j][k1-1][2]+=f[i][j][k1][lst];
	  }
    }
  }
  for (j=0; j<=m; j++) for (lst=0; lst<4; lst++) r+=f[n][j][0][lst];
  printf("%d\n",r.x);
  return 0;
}