{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"MD","content":"![](https://assets.codeforces.com/images/hsu.png)"}},{"title":"Input","value":{"format":"MD","content":"\u003cp\u003eThe first line contains two integers — $$$n$$$ and $$$q$$$ ($$$1 \\le n, q \\le 2 \\cdot 10^5$$$).\u003c/p\u003e\n\u003cp\u003eThe second line contains $$$n$$$ integers $$$a_1, a_2, \\ldots, a_n$$$ ($$$1 \\le a_i \\le 2 \\cdot 10^5$$$) — the elements of the array $$$a$$$ before the changes.\u003c/p\u003e\n\u003cp\u003eThe next $$$q$$$ lines contain queries in the following format: each line contains two integers $$$i$$$ and $$$x$$$ ($$$1 \\le i \\le n$$$, $$$1 \\le x \\le 2 \\cdot 10^5$$$).\u003c/p\u003e"}},{"title":"Output","value":{"format":"MD","content":"\u003cp\u003ePrint $$$q$$$ lines: after processing each query output the GCD of all elements modulo $$$10^9+7$$$ on a separate line.\u003c/p\u003e"}},{"title":"Example","value":{"format":"MD","content":"\u003cdiv class\u003d\"sample-test\"\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e4 3\n1 6 8 12\n1 12\n2 3\n3 3\n\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003e2\n2\n6\n\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}},{"title":"Note","value":{"format":"MD","content":"\u003cp\u003eAfter the first query the array is $$$[12, 6, 8, 12]$$$, $$$\\operatorname{gcd}(12, 6, 8, 12) \u003d 2$$$.\u003c/p\u003e\n\u003cp\u003eAfter the second query — $$$[12, 18, 8, 12]$$$, $$$\\operatorname{gcd}(12, 18, 8, 12) \u003d 2$$$.\u003c/p\u003e\n\u003cp\u003eAfter the third query — $$$[12, 18, 24, 12]$$$, $$$\\operatorname{gcd}(12, 18, 24, 12) \u003d 6$$$.\u003c/p\u003e\n\u003cp\u003eHere the $$$\\operatorname{gcd}$$$ function denotes the greatest common divisor.\u003c/p\u003e"}}]}