{"raw_statement":[{"iden":"problem statement","content":"You are given integers $R$, $G$, $B$, and $K$. How many strings $S$ consisting of `R`, `G`, and `B` satisfy all of the conditions below? Find the count modulo $998244353$.\n\n*   The number of occurrences of `R`, `G`, and `B` in $S$ are $R$, $G$, and $B$, respectively.\n*   The number of occurrences of `RG` as (contiguous) substrings in $S$ is $K$."},{"iden":"constraints","content":"*   $1 \\leq R,G,B\\leq 10^6$\n*   $0 \\leq K \\leq \\mathrm{min}(R,G)$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$R$ $G$ $B$ $K$"},{"iden":"sample input 1","content":"2 1 1 1"},{"iden":"sample output 1","content":"6\n\nThe following six strings satisfy the conditions.\n\n*   `RRGB`\n*   `RGRB`\n*   `RGBR`\n*   `RBRG`\n*   `BRRG`\n*   `BRGR`"},{"iden":"sample input 2","content":"1000000 1000000 1000000 1000000"},{"iden":"sample output 2","content":"80957240\n\nFind the count modulo $998244353$."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}