{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eYou have got a job offer from a secret project of the Agency of Federal Security under the code name “GCD 2010”.\r\nThe subject of research is a collection of positive integer numbers. Your goal is to calculate\r\nhow the greatest common divisor of all numbers in this collection changes as we insert numbers into this collection\r\nand remove them from it. At the beginning of the experiment, the collection is empty.\u003c/div\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eThe first line contains an integer \u003ci\u003eq\u003c/i\u003e (1 ≤ \u003ci\u003eq\u003c/i\u003e ≤ 10\u003csup\u003e5\u003c/sup\u003e), which is the number of operations with the collection.\r\nEach of the next \u003ci\u003eq\u003c/i\u003e lines has either the form “+\u0026nbsp;x” or “-\u0026nbsp;x”. In the first case, number \u003ci\u003ex\u003c/i\u003e is inserted into the collection,\r\nin the latter case it is removed from the collection. The number \u003ci\u003ex\u003c/i\u003e is a positive integer not exceeding 10\u003csup\u003e9\u003c/sup\u003e. It is guaranteed\r\nthat operations remove only the integers which lie in the collection.\u003c/div\u003e\u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eOutput the greatest common divisor of all numbers in the collection after each of the given operation.\r\nAccording to the 190R order, the greatest common divisor of an empty collection is equal to one.\u003c/div\u003e\u003c/div\u003e"}},{"title":"Sample","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\r\n+ 8\r\n+ 6\r\n+ 8\r\n- 8\r\n- 8\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e8\r\n2\r\n2\r\n2\r\n6\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}