#include using namespace std; typedef long long ll; ll dp[4010][4010][2][2] = {},mod = 998244353; ll sum[4010][4010] = {}; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); int i,j; dp[0][0][0][1] = dp[0][0][1][1] = 1; for(i=0;i<=4000;i++){ for(j=0;j<=4000;j++){ (dp[i + 1][j][0][0] += dp[i][j][0][0] + dp[i][j][0][1]) %= mod; (dp[i][j + 1][1][0] += dp[i][j][0][0] + dp[i][j][0][1]) %= mod; (dp[i][j + 1][1][1] += dp[i][j][0][0]) %= mod; (dp[i][j + 1][1][0] += dp[i][j][1][0] + dp[i][j][1][1]) %= mod; (dp[i + 1][j][0][0] += dp[i][j][1][0] + dp[i][j][1][1]) %= mod; (dp[i + 1][j][0][1] += dp[i][j][1][0]) %= mod; } } for(j=0;j<=4000;j++){ sum[0][j] = 0; for(i=0;i + j<=4000;i++){ (sum[i + 1][j] += sum[i][j] + dp[i + j][i][0][0] + dp[i + j][i][0][1] + dp[i + j][i][1][0] + dp[i + j][i][1][1]) %= mod; } } int q; cin >> q; for(i=0;i> x >> y; if(x