#include using namespace std; #define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i ) #define rep(i,n) REP(i,0,n) using ll = long long; const ll mod=998244353 ; ll dp[202020][6][6][6]; int main(){ int n,t; cin>>n>>t; dp[0][0][0][0]=1; rep(i,n)rep(j,t)rep(k,t)rep(l,t){ dp[i][j][k][l]%=mod; dp[i+1][j][k][(k+l)%t]+=dp[i+1][j][k][l]; dp[i+1][j][(j+k)%t][l]+=dp[i+1][j][k][l]; dp[i+1][(j+1)%t][k][l]+=dp[i+1][j][k][l]; } cout<