{"trustable":true,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n h1 { font-size: 1.2em; }\n\u003c/style\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\n\u003cdiv class\u003d\"md\"\u003e\u003cp\u003eYou have \u003cspan class\u003d\"math inline\"\u003e$ n $\u003c/span\u003e coins, each of which has a distinct weight.\u003c/p\u003e\n\u003cp\u003eThere are two stacks which are initially empty. On each step you move one coin to a stack. You never remove a coin from a stack.\u003c/p\u003e\n\u003cp\u003eAfter each move, your task is to determine which stack is heavier (if we can be sure that either stack is heavier).\u003c/p\u003e\n\u003ch1 id\u003d\"input\"\u003eInput\u003c/h1\u003e\n\u003cp\u003eThe first input line has an integer \u003cspan class\u003d\"math inline\"\u003e$ n $\u003c/span\u003e: the number of coins. The coins are numbered \u003cspan class\u003d\"math inline\"\u003e$ 1,2,\\dots,n $\u003c/span\u003e. You know that coin \u003cspan class\u003d\"math inline\"\u003e$ i $\u003c/span\u003e is always heavier than coin \u003cspan class\u003d\"math inline\"\u003e$ i-1 $\u003c/span\u003e, but you don\u0027t know their exact weights.\u003c/p\u003e\n\u003cp\u003eAfter this, there are \u003cspan class\u003d\"math inline\"\u003e$ n $\u003c/span\u003e lines that describe the moves. Each line has two integers \u003cspan class\u003d\"math inline\"\u003e$ c $\u003c/span\u003e and \u003cspan class\u003d\"math inline\"\u003e$ s $\u003c/span\u003e: move coin \u003cspan class\u003d\"math inline\"\u003e$ c $\u003c/span\u003e to stack \u003cspan class\u003d\"math inline\"\u003e$ s $\u003c/span\u003e (1 \u003d left, 2 \u003d right).\u003c/p\u003e\n\u003ch1 id\u003d\"output\"\u003eOutput\u003c/h1\u003e\n\u003cp\u003eAfter each move, print \u003ccode\u003e\u0026lt;\u003c/code\u003e if the right stack is heavier, \u003ccode\u003e\u0026gt;\u003c/code\u003e if the left stack is heavier, and \u003ccode\u003e?\u003c/code\u003e if we can\u0027t know which stack is heavier.\u003c/p\u003e\n\u003ch1 id\u003d\"constraints\"\u003eConstraints\u003c/h1\u003e\n\u003cul\u003e\n\u003cli\u003e\u003cspan class\u003d\"math inline\"\u003e$ 1 \\le n \\le 2 \\cdot 10^5 $\u003c/span\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch1 id\u003d\"example\"\u003eExample\u003c/h1\u003e\n\u003ctable class\u003d\"vjudge_sample\"\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\u003e3\n2 1\n3 2\n1 1\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e\u0026gt;\n\u0026lt;\n?\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003cp\u003eExplanation: After the last move, if the coins are \u003cspan class\u003d\"math inline\"\u003e$ [2,3,4] $\u003c/span\u003e, the left stack is heavier, but if the coins are \u003cspan class\u003d\"math inline\"\u003e$ [1,2,5] $\u003c/span\u003e, the right stack is heavier.\u003c/p\u003e\n\u003c/div\u003e "}}]}