{"problem":{"name":"Yet Another ABC String","description":{"content":"You are given integers $A$, $B$, and $C$. How many strings $S$ consisting of `A`, `B`, and `C` satisfy all of the following conditions? Find the count modulo $998244353$. *   The number of occurrence","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"agc058_d"},"statements":[{"statement_type":"Markdown","content":"You are given integers $A$, $B$, and $C$. How many strings $S$ consisting of `A`, `B`, and `C` satisfy all of the following conditions? Find the count modulo $998244353$.\n\n*   The number of occurrences of `A`, `B`, and `C` in $S$ are $A$, $B$, and $C$, respectively.\n*   $S$ contains none of `ABC`, `BCA`, and `CAB` as a (contiguous) substring.\n\n## Constraints\n\n*   $1 \\leq A,B,C \\leq 10^6$\n*   All values in input are integers.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$A$ $B$ $C$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"agc058_d","tags":[],"sample_group":[["1 1 1","3\n\nThe three strings that satisfy the conditions are `ACB`, `CBA`, and `BAC`."],["2 2 2","42"],["96 11 46","818015722"],["125132 102271 152064","128086069"]],"created_at":"2026-03-03 11:01:14"}}