{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eAfter government of the Kingdom of Mages had formed a new army, they had to elect its\r\nwarlord. Two wisest Masters, head of the Kingdom Zagamius and lich Sandro, decided\r\nto interview some candidates. They entered two different cabinets and started to invite\r\ncertain mages for an interview or let go the mages they already talked to. Sandro and Zagamius\r\ncould call the same mage for an interview several times and there could be more than one\r\nmage in their cabinets at some moments.\u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eEach Master defined an order in which he will invite mages and let them go.\r\nIf at certain moment both Masters can perform an action, then one of them performs it and the other\r\none waits for him. In some cases only one Master can perform his action.\r\nFor example, if Sandro invites a mage \u003ci\u003ea\u003c/i\u003e, and this mage is being interviewed by Zagamius at that moment,\r\nthen Sandro will wait until the mage \u003ci\u003ea\u003c/i\u003e is free.\u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eUnfortunately, there can be a situation when both Masters will wait for each other.\r\nIn that case they won\u0027t elect the warlord of the army of mages and will lose a war that\r\nhaven\u0027t yet started. Your should determine whether such a stupid defeat is possible.\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 the number of test cases \u003ci\u003et\u003c/i\u003e (1 ≤ \u003ci\u003et\u003c/i\u003e ≤ 10).\r\nEach test case starts with a line containing space-separated integers \u003ci\u003en\u003c/i\u003e, \u003ci\u003em\u003c/i\u003e and \u003ci\u003ek\u003c/i\u003e (1 ≤ \u003ci\u003en\u003c/i\u003e, \u003ci\u003em\u003c/i\u003e, \u003ci\u003ek\u003c/i\u003e ≤ 1\u0026nbsp;000),\r\nwhich are the number of actions planned by Sandro, the number of actions planned by Zagamius and the number of mages\r\nin the new army. Mages are numbered with integers from 1 to \u003ci\u003ek\u003c/i\u003e.\r\nThe next \u003ci\u003en\u003c/i\u003e lines contain the Sandro\u0027s plan. Each line contains a sign “+” or “-” and an integer \u003ci\u003ei\u003c/i\u003e (1 ≤ \u003ci\u003ei\u003c/i\u003e ≤ \u003ci\u003ek\u003c/i\u003e).\r\nSign “+” means that Sandro wants to invite the \u003ci\u003ei\u003c/i\u003e-th mage, and sign “-” means that he wants to let him go.\r\nThe next \u003ci\u003em\u003c/i\u003e lines contain the plan of Zagamius in the same format.\r\nIn both plans Masters let a mage go only if he is present in his cabinet.\r\nIt is guaranteed that no Master will invite a mage if he is already present in his cabinet.\r\nIf all the planned actions are performed, the cabinets of both Masters will be empty.\u003c/div\u003e\u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eFor each test case, output “:-)” if both Masters will certainly perform all the planned actions\r\nand will elect the warlord. In the other case, output “:-(”.\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\u003e2\r\n4 4 2\r\n+ 1\r\n+ 2\r\n- 2\r\n- 1\r\n+ 1\r\n+ 2\r\n- 2\r\n- 1\r\n4 4 2\r\n+ 1\r\n+ 2\r\n- 1\r\n- 2\r\n+ 2\r\n+ 1\r\n- 2\r\n- 1\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e:-)\r\n:-(\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}