{"raw_statement":[{"iden":"problem statement","content":"There is an $N \\times N$ grid. Let $(i,j)$ denote the cell at the $i$\\-th row from the top and the $j$\\-th column from the left.\nFor $K = 1, 2, \\ldots, N$, a **level $K$ L-shape** is a set of $2K - 1$ cells that satisfies at least one of the following four conditions:\n\n*   All cells reachable from a certain cell $(i,j)$ by moving down or right between $0$ and $K-1$ cells, inclusive (where $1 \\leq i \\leq N-K+1$, $1 \\leq j \\leq N-K+1$).\n*   All cells reachable from a certain cell $(i,j)$ by moving down or left between $0$ and $K-1$ cells, inclusive (where $1 \\leq i \\leq N-K+1$, $K \\leq j \\leq N$).\n*   All cells reachable from a certain cell $(i,j)$ by moving up or right between $0$ and $K-1$ cells, inclusive (where $K \\leq i \\leq N$, $1 \\leq j \\leq N-K+1$).\n*   All cells reachable from a certain cell $(i,j)$ by moving up or left between $0$ and $K-1$ cells, inclusive (where $K \\leq i \\leq N$, $K \\leq j \\leq N$).\n\nYou are given a cell $(a,b)$ and $Q$ queries $k_1, \\ldots, k_Q$.\nFor each $i$, print the number, modulo $998244353$, of ways to partition the entire grid into exactly one level $1$ L-shape, one level $2$ L-shape, $\\ldots$, and one level $N$ L-shape so that cell $(a,b)$ is contained in the level $k_i$ L-shape."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 10^7$\n*   $1 \\leq a \\leq N$\n*   $1 \\leq b \\leq N$\n*   $1 \\leq Q \\leq \\min\\lbrace N, 200000 \\rbrace$\n*   $1 \\leq k_1 < \\cdots < k_Q \\leq N$\n*   All input values are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$ $a$ $b$\n$Q$\n$k_1$ $\\cdots$ $k_Q$"},{"iden":"sample input 1","content":"3 1 2\n1\n2"},{"iden":"sample output 1","content":"6\n\nThe six ways shown in the following figure are the solutions. In the figure, an integer $k$ in a cell means that the cell belongs to the level $k$ L-shape.\n![image](https://img.atcoder.jp/arc190/d853bd693f0d3848c725803512dc382a.png)"},{"iden":"sample input 2","content":"5 2 5\n3\n1 3 5"},{"iden":"sample output 2","content":"4\n32\n128"},{"iden":"sample input 3","content":"100 50 50\n4\n1 10 50 100"},{"iden":"sample output 3","content":"934228871\n758172260\n444239843\n0"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}