{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eSituation similar to the one in the problem \u003ca href\u003d\"/problems/2848\"\u003eDeviantArt\u003c/a\u003e, occured on MySpace website.\u003c/p\u003e\n\n\u003cp\u003eBrie\u001dy, two bots had to increase photos rating - Each \"Like\" on the picture increases its rating by \u003cstrong\u003e1\u003c/strong\u003e. First bot \"Likes\" all the photos with numbers \u003cstrong\u003eK\u003c/strong\u003e such that \u003cstrong\u003eK mod A \u003d I\u003c/strong\u003e. The second bot counts the rating of all the pictures with numbers \u003cstrong\u003eL\u003c/strong\u003e such that \u003cstrong\u003eL mod B \u003d J\u003c/strong\u003e. Pictures are enumerated starting from \u003cstrong\u003e0\u003c/strong\u003e.\u003c/p\u003e\n\n\u003cp\u003e\u003ch2\u003eInput\u003c/h2\u003e\u003c/p\u003e\n\n\u003cp\u003eFour number \u003cstrong\u003eN\u003c/strong\u003e, \u003cstrong\u003eA\u003c/strong\u003e, \u003cstrong\u003eB\u003c/strong\u003e and \u003cstrong\u003eQ\u003c/strong\u003e (\u003cstrong\u003e1\u003c/strong\u003e ≤ \u003cstrong\u003eN\u003c/strong\u003e ≤ \u003cstrong\u003e10^5\u003c/strong\u003e, \u003cstrong\u003e1\u003c/strong\u003e ≤ \u003cstrong\u003eA\u003c/strong\u003e ≤ \u003cstrong\u003eN\u003c/strong\u003e, \u003cstrong\u003e1\u003c/strong\u003e ≤ \u003cstrong\u003eB\u003c/strong\u003e ≤ \u003cstrong\u003eN\u003c/strong\u003e, \u003cstrong\u003e0\u003c/strong\u003e ≤ \u003cstrong\u003eQ\u003c/strong\u003e ≤ \u003cstrong\u003e10^5\u003c/strong\u003e) re given in the \u001crst line - number of the photos, bot step values, which don\u0027t change during their life, and total number of iterations. In every next lines command for the bot is written:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cp\u003e\u003cli\u003e \u003cstrong\u003es I\u003c/strong\u003e --- first bot \"Likes\" photos \u003cstrong\u003eI\u003c/strong\u003e, \u003cstrong\u003eI+A\u003c/strong\u003e, \u003cstrong\u003eI+2A\u003c/strong\u003e, \u003cstrong\u003eI+3A\u003c/strong\u003e, ... (\u003cstrong\u003e0\u003c/strong\u003e ≤ \u003cstrong\u003eI\u003c/strong\u003e \u003c \u003cstrong\u003eA\u003c/strong\u003e).\u003c/p\u003e\n\n\u003cp\u003e\u003cli\u003e \u003cstrong\u003eg J\u003c/strong\u003e --- second bot sums \"Likes\" of photos \u003cstrong\u003eJ\u003c/strong\u003e, \u003cstrong\u003eJ+B\u003c/strong\u003e, \u003cstrong\u003eJ+2B\u003c/strong\u003e, \u003cstrong\u003eJ+3B\u003c/strong\u003e, ... (\u003cstrong\u003e0\u003c/strong\u003e ≤ \u003cstrong\u003eJ\u003c/strong\u003e \u003c \u003cstrong\u003eB\u003c/strong\u003e).\u003c/p\u003e\n\n\u003c/ul\u003e\n\n\u003cp\u003eBefore bots start their activity, all photos had rating \u003cstrong\u003e0\u003c/strong\u003e.\u003c/p\u003e\n\n\u003cp\u003e\u003ch2\u003eOutput\u003c/h2\u003e\u003c/p\u003e\n\n\u003cp\u003eFor every command of the second bot, print its result on a separate line.\u003c/p\u003e\n\n"}},{"title":"Example","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\u003e10 2 5 7\ns 0\ng 0\ng 1\ng 2\ns 1\ng 3\ng 4\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\n1\n1\n2\n2\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}