{"trustable":true,"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\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eThere is a country with $$$n$$$ citizens. The $$$i$$$-th of them initially has $$$a_{i}$$$ money. The government strictly controls the wealth of its citizens. Whenever a citizen makes a purchase or earns some money, they must send a receipt to the social services mentioning the amount of money they currently have.\u003c/p\u003e\u003cp\u003eSometimes the government makes payouts to the poor: all citizens who have strictly less money than $$$x$$$ are paid accordingly so that after the payout they have exactly $$$x$$$ money. In this case the citizens don\u0027t send a receipt.\u003c/p\u003e\u003cp\u003eYou know the initial wealth of every citizen and the log of all events: receipts and payouts. Restore the amount of money each citizen has after all events.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains a single integer $$$n$$$ ($$$1 \\le n \\le 2 \\cdot 10^{5}$$$)\u0026nbsp;— the numer of citizens.\u003c/p\u003e\u003cp\u003eThe next line contains $$$n$$$ integers $$$a_1$$$, $$$a_2$$$, ..., $$$a_n$$$ ($$$0 \\le a_{i} \\le 10^{9}$$$)\u0026nbsp;— the initial balances of citizens.\u003c/p\u003e\u003cp\u003eThe next line contains a single integer $$$q$$$ ($$$1 \\le q \\le 2 \\cdot 10^{5}$$$)\u0026nbsp;— the number of events.\u003c/p\u003e\u003cp\u003eEach of the next $$$q$$$ lines contains a single event. The events are given in chronological order.\u003c/p\u003e\u003cp\u003eEach event is described as either \u003cspan class\u003d\"tex-font-style-tt\"\u003e1 p x\u003c/span\u003e ($$$1 \\le p \\le n$$$, $$$0 \\le x \\le 10^{9}$$$), or \u003cspan class\u003d\"tex-font-style-tt\"\u003e2 x\u003c/span\u003e ($$$0 \\le x \\le 10^{9}$$$). In the first case we have a receipt that the balance of the $$$p$$$-th person becomes equal to $$$x$$$. In the second case we have a payoff with parameter $$$x$$$.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003ePrint $$$n$$$ integers\u0026nbsp;— the balances of all citizens after all events.\u003c/p\u003e"}},{"title":"Examples","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\u003e4\n1 2 3 4\n3\n2 3\n1 2 2\n2 1\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e3 2 3 4 \n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","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\n3 50 2 1 10\n3\n1 2 0\n2 8\n1 3 20\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e8 8 20 8 10 \n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eIn the first example the balances change as follows: \u003cspan class\u003d\"tex-font-style-tt\"\u003e1 2 3 4\u003c/span\u003e $$$\\rightarrow$$$ \u003cspan class\u003d\"tex-font-style-tt\"\u003e3 3 3 4\u003c/span\u003e $$$\\rightarrow$$$ \u003cspan class\u003d\"tex-font-style-tt\"\u003e3 2 3 4\u003c/span\u003e $$$\\rightarrow$$$ \u003cspan class\u003d\"tex-font-style-tt\"\u003e3 2 3 4\u003c/span\u003e\u003c/p\u003e\u003cp\u003eIn the second example the balances change as follows: \u003cspan class\u003d\"tex-font-style-tt\"\u003e3 50 2 1 10\u003c/span\u003e $$$\\rightarrow$$$ \u003cspan class\u003d\"tex-font-style-tt\"\u003e3 0 2 1 10\u003c/span\u003e $$$\\rightarrow$$$ \u003cspan class\u003d\"tex-font-style-tt\"\u003e8 8 8 8 10\u003c/span\u003e $$$\\rightarrow$$$ \u003cspan class\u003d\"tex-font-style-tt\"\u003e8 8 20 8 10\u003c/span\u003e\u003c/p\u003e"}}]}