#include using namespace std; const long long int MOD = 998244353; vector > mul(vector > a, vector> b) { int n = a.size(); int m = a[0].size(); int k = b[0].size(); vector >c(n, vector(k,0)); for (int i = 0; i < n; i++) { for (int j = 0; j < k; j++) { for (int k = 0; k < m; k++) { c[i][j] += ((a[i][k]%MOD) * (b[k][j]%MOD)%MOD); c[i][j] %= MOD; } } } return c; } int main(void) { cin.tie(0); ios::sync_with_stdio(false); int n,k; cin >> n >> k; vector > A(k*k*k,vector(k*k*k,0)); vector > B(k*k*k,vector(k*k*k,0)); B[0][0] = 1; for(int a=0;a0) { if(n%2==1) { B = mul(A,B); } A = mul(A,A); n/=2; } //cout << b[14*A + B][14*A + B] << '\n'; long long int res = 0; for(int i=0;i