d = {}
n = 49
k = 1808
d[(1,1,1)] = 1 # first coordinate is length, second longest consec, third current consec
for i in range(2,n+1):
    for key in d.keys():
        mx = max(key[1],key[2]+1)
        d[(key[0]+1,mx,key[2]+1)] = d.get((key[0]+1,mx,key[2]+1),0) + d[key]
        d[(key[0]+1,key[1],1)] = d.get((key[0]+1,key[1],1), 0) + d[key]
        del d[key]
ans = 0
longest = {}
for i in d.keys():
    longest[i[1]] = longest.get(i[1],0) + d[i]
    longest[i[1]] %= 998244353
for key in longest.keys():
    for keya in longest.keys():
        if key*keya < k:
            ans += longest[key]*longest[keya]
            ans %= 998244353
print (ans*2) % 998244353