{"raw_statement":[{"iden":"problem statement","content":"There is a grid with $H$ rows and $W$ columns.\nThis grid has $H(W+1)$ vertical edges and $W(H+1)$ horizontal edges, for a total of $H(W+1) + W(H+1)$ (see also the figures at Sample Input/Output). Consider marking these edges by the following two kinds of operations.\n\n*   **Operation (1)**: Choose a square whose left and upper edges are unmarked when performing this operation. Mark the left and upper edges of that square.\n*   **Operation (2)**: Choose a square whose right and lower edges are unmarked when performing this operation. Mark the right and lower edges of that square.\n\nFind the number, modulo $998244353$, of possible sets of edges that are eventually marked when Operations (1) and (2) can be performed any number of times, possibly zero.\nYou have $T$ test cases to solve."},{"iden":"constraints","content":"*   $1\\leq T\\leq 2\\times 10^5$\n*   $1\\leq H, W\\leq 10^6$"},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$T$\n$\\text{case}_1$\n$\\vdots$\n$\\text{case}_T$\n\nEach test case is given in the following format:\n\n$H$ $W$"},{"iden":"sample input 1","content":"2\n1 1\n2 3"},{"iden":"sample output 1","content":"4\n800\n\nFor the case $(H, W)=(1,1)$, there are four possible sets of edges that are eventually marked, as shown below. The marked edges are drawn in bold.\n![image](https://img.atcoder.jp/arc166/bd84a15ada55c0df6d4e66863053bd59.png)\nFor the case $(H, W)=(2,3)$, the following sets of marked edges are **possible**:\n![image](https://img.atcoder.jp/arc166/66c77b9132c38d82c36732966ff3ae4f.png)\nOn the other hand, the following sets of marked edges are **impossible**:\n![image](https://img.atcoder.jp/arc166/0029e3cc83a0232231ddf6e280c7f9a8.png)"},{"iden":"sample input 2","content":"3\n123 456\n654 321\n1000000 1000000"},{"iden":"sample output 2","content":"60549740\n298307903\n656009181"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}