{"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\u003eOur bear\u0027s forest has a checkered field. The checkered field is an \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e × \u003ci\u003en\u003c/i\u003e\u003c/span\u003e table, the rows are numbered from 1 to \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e from top to bottom, the columns are numbered from 1 to \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e from left to right. Let\u0027s denote a cell of the field on the intersection of row \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ex\u003c/i\u003e\u003c/span\u003e and column \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ey\u003c/i\u003e\u003c/span\u003e by record \u003cspan class\u003d\"tex-span\"\u003e(\u003ci\u003ex\u003c/i\u003e, \u003ci\u003ey\u003c/i\u003e)\u003c/span\u003e. Each cell of the field contains growing raspberry, at that, the cell \u003cspan class\u003d\"tex-span\"\u003e(\u003ci\u003ex\u003c/i\u003e, \u003ci\u003ey\u003c/i\u003e)\u003c/span\u003e of the field contains \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ex\u003c/i\u003e + \u003ci\u003ey\u003c/i\u003e\u003c/span\u003e raspberry bushes.\u003c/p\u003e\u003cp\u003eThe bear came out to walk across the field. At the beginning of the walk his speed is \u003cspan class\u003d\"tex-span\"\u003e(\u003ci\u003edx\u003c/i\u003e, \u003ci\u003edy\u003c/i\u003e)\u003c/span\u003e. Then the bear spends exactly \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003et\u003c/i\u003e\u003c/span\u003e seconds on the field. Each second the following takes place:\u003c/p\u003e\u003cul\u003e \u003cli\u003e Let\u0027s suppose that at the current moment the bear is in cell \u003cspan class\u003d\"tex-span\"\u003e(\u003ci\u003ex\u003c/i\u003e, \u003ci\u003ey\u003c/i\u003e)\u003c/span\u003e. \u003c/li\u003e\u003cli\u003e First the bear eats the raspberry from all the bushes he has in the current cell. After the bear eats the raspberry from \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ek\u003c/i\u003e\u003c/span\u003e bushes, he increases each component of his speed by \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ek\u003c/i\u003e\u003c/span\u003e. In other words, if before eating the \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ek\u003c/i\u003e\u003c/span\u003e bushes of raspberry his speed was \u003cspan class\u003d\"tex-span\"\u003e(\u003ci\u003edx\u003c/i\u003e, \u003ci\u003edy\u003c/i\u003e)\u003c/span\u003e, then after eating the berry his speed equals \u003cspan class\u003d\"tex-span\"\u003e(\u003ci\u003edx\u003c/i\u003e + \u003ci\u003ek\u003c/i\u003e, \u003ci\u003edy\u003c/i\u003e + \u003ci\u003ek\u003c/i\u003e)\u003c/span\u003e. \u003c/li\u003e\u003cli\u003e Let\u0027s denote the current speed of the bear \u003cspan class\u003d\"tex-span\"\u003e(\u003ci\u003edx\u003c/i\u003e, \u003ci\u003edy\u003c/i\u003e)\u003c/span\u003e (it was increased after the previous step). Then the bear moves from cell \u003cspan class\u003d\"tex-span\"\u003e(\u003ci\u003ex\u003c/i\u003e, \u003ci\u003ey\u003c/i\u003e)\u003c/span\u003e to cell \u003cspan class\u003d\"tex-span\"\u003e(((\u003ci\u003ex\u003c/i\u003e + \u003ci\u003edx\u003c/i\u003e - 1)\u0026nbsp;\u003ci\u003emod\u003c/i\u003e\u0026nbsp;\u003ci\u003en\u003c/i\u003e) + 1, ((\u003ci\u003ey\u003c/i\u003e + \u003ci\u003edy\u003c/i\u003e - 1)\u0026nbsp;\u003ci\u003emod\u003c/i\u003e\u0026nbsp;\u003ci\u003en\u003c/i\u003e) + 1)\u003c/span\u003e. \u003c/li\u003e\u003cli\u003e Then one additional raspberry bush grows in each cell of the field. \u003c/li\u003e\u003c/ul\u003e\u003cp\u003eYou task is to predict the bear\u0027s actions. Find the cell he ends up in if he starts from cell \u003cspan class\u003d\"tex-span\"\u003e(\u003ci\u003esx\u003c/i\u003e, \u003ci\u003esy\u003c/i\u003e)\u003c/span\u003e. Assume that each bush has infinitely much raspberry and the bear will never eat all of it.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line of the input contains six space-separated integers: \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e, \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003esx\u003c/i\u003e\u003c/span\u003e, \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003esy\u003c/i\u003e\u003c/span\u003e, \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003edx\u003c/i\u003e\u003c/span\u003e, \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003edy\u003c/i\u003e\u003c/span\u003e, \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003et\u003c/i\u003e\u003c/span\u003e \u003cspan class\u003d\"tex-span\"\u003e(1 ≤ \u003ci\u003en\u003c/i\u003e ≤ 10\u003csup class\u003d\"upper-index\"\u003e9\u003c/sup\u003e;\u0026nbsp;1 ≤ \u003ci\u003esx\u003c/i\u003e, \u003ci\u003esy\u003c/i\u003e ≤ \u003ci\u003en\u003c/i\u003e;\u0026nbsp; - 100 ≤ \u003ci\u003edx\u003c/i\u003e, \u003ci\u003edy\u003c/i\u003e ≤ 100;\u0026nbsp;0 ≤ \u003ci\u003et\u003c/i\u003e ≤ 10\u003csup class\u003d\"upper-index\"\u003e18\u003c/sup\u003e)\u003c/span\u003e.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003ePrint two integers — the coordinates of the cell the bear will end up in after \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003et\u003c/i\u003e\u003c/span\u003e seconds.\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\u003e5 1 2 0 1 2\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e3 1\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\u003e1 1 1 -1 -1 2\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1 1\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\u003eOperation \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ea\u003c/i\u003e\u0026nbsp;\u003ci\u003emod\u003c/i\u003e\u0026nbsp;\u003ci\u003eb\u003c/i\u003e\u003c/span\u003e means taking the remainder after dividing \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ea\u003c/i\u003e\u003c/span\u003e by \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eb\u003c/i\u003e\u003c/span\u003e. Note that the result of the operation is always non-negative. For example, \u003cspan class\u003d\"tex-span\"\u003e( - 1)\u0026nbsp;\u003ci\u003emod\u003c/i\u003e\u0026nbsp;3 \u003d 2\u003c/span\u003e.\u003c/p\u003e\u003cp\u003eIn the first sample before the first move the speed vector will equal (3,4) and the bear will get to cell (4,1). Before the second move the speed vector will equal (9,10) and he bear will get to cell (3,1). Don\u0027t forget that at the second move, the number of berry bushes increased by 1.\u003c/p\u003e\u003cp\u003eIn the second sample before the first move the speed vector will equal (1,1) and the bear will get to cell (1,1). Before the second move, the speed vector will equal (4,4) and the bear will get to cell (1,1). Don\u0027t forget that at the second move, the number of berry bushes increased by 1.\u003c/p\u003e"}}]}