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:
//Author: ReseeCher
#include<bits/stdc++.h>
#define LL long long
#define F(x,y,z) for(int x=y;x<=z;++x)
#define D(x,y,z) for(int x=y;x>=z;--x)
#define ckmax(a,b) (a)=max(a,b)
#define ckmin(a,b) (a)=min(a,b)
#define pb push_back
#define Ad(x,y) (x)=((x)+(y))%P
using namespace std;
const int N=305;
const int P=998244353;
LL R(){
    LL ans=0,f=1;char c=getchar();
    for(;c<'0'||c>'9';c=getchar()) if (c=='-') f=-1;
    for(;c>='0'&&c<='9';c=getchar()) ans=ans*10+c-'0';
    return ans*f;
}
int a[N],n,m;
LL dp[N][N][N];
char s[N];
LL an[N];
int main(){
	//freopen("1.in","r",stdin);
	//freopen("1.out","w",stdout);
	cin>>(s+1);int len=strlen(s+1);
	int K=R();
	++n;
	F(i,1,len)
		if(s[i]=='1')++a[n],++m;
		else ++n;
	
	dp[0][0][0]=1;
	F(i,0,n-1)
		F(j,0,m)
			F(k,0,m){
				if(!dp[i][j][k])continue;
				int lim=min(m+a[i+1]-j,min(m+a[i+1]-k,m));
				F(u,max(a[i+1]-j,0),lim){
					Ad(dp[i+1][j+(u-a[i+1])][k+max(0,u-a[i+1])],dp[i][j][k]);
				}
			}
	F(i,0,m)an[i]=dp[n][0][i];
	F(i,1,m)Ad(an[i],an[i-1]);
	cout<<an[min(K,m)];
    return 0;
}