{"trustable":true,"sections":[{"title":"","value":{"format":"MD","content":"You have two arrays **A** and **B** of the same length. You must process three kinds of queries.\r\n\r\n- \\* **l r x**: add an integer **x** to all `A[i]` where **l** ≤ **i** ≤ **r**.\r\n- **. l r x**: add an integer **x** to all `B[i]` where **l** ≤ **i** ≤ **r**.\r\n- **? l r**: calculate the sum `A[l]` · `B[l]` + ... + `A[r]` · `B[r]`.\r\n\r\nArrays are **1**-indexed. Initially, both arrays are filled with zeroes.\r\n\r\n#### Input\r\nThe first line contains two space-separated integers **n** and **m**: the arrays\u0027 lengths and the number of queries, respectively (**1** ≤ **n**, **m** ≤ `10^5`). The next **m** lines contain queries in the format described above. In each query **1** ≤ **l** ≤ **r** ≤ **n** and **1** ≤ **x** \u003c `10^9` + **7**.\r\n\r\n#### Output\r\nFor each query of the third type, print its result modulo `10^9` + **7** on a separate line."}},{"title":"Example","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e5 4\n* 1 4 10\n. 2 5 8\n? 1 3\n? 2 5\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e160\n240\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}