{"raw_statement":[{"iden":"problem statement","content":"We have an $N \\times M$ matrix, whose elements are initially all $0$.\nProcess $Q$ given queries. Each query is in one of the following formats.\n\n*   `1 l r x` : Add $x$ to every element in the $l$\\-th, $(l+1)$\\-th, $\\ldots$, and $r$\\-th column.\n*   `2 i x`: Replace every element in the $i$\\-th row with $x$.\n*   `3 i j`: Print the $(i, j)$\\-th element."},{"iden":"constraints","content":"*   $1 \\leq N, M, Q \\leq 2 \\times 10^5$\n*   Every query is in one of the formats listed in the Problem Statement.\n*   For each query in the format `1 l r x`, $1 \\leq l \\leq r \\leq M$ and $1 \\leq x \\leq 10^9$.\n*   For each query in the format `2 i x`, $1 \\leq i \\leq N$ and $1 \\leq x \\leq 10^9$.\n*   For each query in the format `3 i j`, $1 \\leq i \\leq N$ and $1 \\leq j \\leq M$.\n*   At least one query in the format `3 i j` is given.\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$ $M$ $Q$\n$\\mathrm{Query}_1$\n$\\vdots$\n$\\mathrm{Query}_Q$\n\n$\\mathrm{Query}_i$, which denotes the $i$\\-th query, is in one of the following formats:\n\n$1$ $l$ $r$ $x$\n\n$2$ $i$ $x$\n\n$3$ $i$ $j$"},{"iden":"sample input 1","content":"3 3 9\n1 1 2 1\n3 2 2\n2 3 2\n3 3 3\n3 3 1\n1 2 3 3\n3 3 2\n3 2 3\n3 1 2"},{"iden":"sample output 1","content":"1\n2\n2\n5\n3\n4\n\nThe matrix transitions as follows.\n$\\begin{pmatrix} 0 & 0 & 0 \\\\ 0 & 0 & 0 \\\\ 0 & 0 & 0 \\\\ \\end{pmatrix} \\rightarrow \\begin{pmatrix} 1 & 1 & 0 \\\\ 1 & 1 & 0 \\\\ 1 & 1 & 0 \\\\ \\end{pmatrix} \\rightarrow \\begin{pmatrix} 1 & 1 & 0 \\\\ 1 & 1 & 0 \\\\ 2 & 2 & 2 \\\\ \\end{pmatrix} \\rightarrow \\begin{pmatrix} 1 & 4 & 3 \\\\ 1 & 4 & 3 \\\\ 2 & 5 & 5 \\\\ \\end{pmatrix}$"},{"iden":"sample input 2","content":"1 1 10\n1 1 1 1000000000\n1 1 1 1000000000\n1 1 1 1000000000\n1 1 1 1000000000\n1 1 1 1000000000\n1 1 1 1000000000\n1 1 1 1000000000\n1 1 1 1000000000\n1 1 1 1000000000\n3 1 1"},{"iden":"sample output 2","content":"9000000000"},{"iden":"sample input 3","content":"10 10 10\n1 1 8 5\n2 2 6\n3 2 1\n3 4 7\n1 5 9 7\n3 3 2\n3 2 8\n2 8 10\n3 8 8\n3 1 10"},{"iden":"sample output 3","content":"6\n5\n5\n13\n10\n0"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}