{"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\u003eJon Snow now has to fight with White Walkers. He has \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e rangers, each of which has his own strength. Also Jon Snow has his favourite number \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ex\u003c/i\u003e\u003c/span\u003e. Each ranger can fight with a white walker only if the strength of the white walker equals his strength. He however thinks that his rangers are weak and need to improve. Jon now thinks that if he takes the bitwise XOR of strengths of some of rangers with his favourite number \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ex\u003c/i\u003e\u003c/span\u003e, he might get soldiers of high strength. So, he decided to do the following operation \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ek\u003c/i\u003e\u003c/span\u003e times: \u003c/p\u003e\u003col\u003e\u003cli\u003e Arrange all the rangers in a straight line in the order of increasing strengths.\u003c/li\u003e\u003cli\u003e Take the bitwise XOR (is written as \u003cimg align\u003d\"middle\" class\u003d\"tex-formula\" src\u003d\"CDN_BASE_URL/f2fe3e60ef565744bf61ec18d7bc2fbe?v\u003d1715413499\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e) of the strength of each alternate ranger with \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ex\u003c/i\u003e\u003c/span\u003e and update it\u0027s strength.\u003c/li\u003e\u003c/ol\u003e Suppose, Jon has \u003cspan class\u003d\"tex-span\"\u003e5\u003c/span\u003e rangers with strengths \u003cspan class\u003d\"tex-span\"\u003e[9, 7, 11, 15, 5]\u003c/span\u003e and he performs the operation \u003cspan class\u003d\"tex-span\"\u003e1\u003c/span\u003e time with \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ex\u003c/i\u003e \u003d 2\u003c/span\u003e. He first arranges them in the order of their strengths, \u003cspan class\u003d\"tex-span\"\u003e[5, 7, 9, 11, 15]\u003c/span\u003e. Then he does the following: \u003col\u003e\u003cli\u003e The strength of first ranger is updated to \u003cimg align\u003d\"middle\" class\u003d\"tex-formula\" src\u003d\"CDN_BASE_URL/b76fb6fc9198cf9d858d5c5269fd7522?v\u003d1715413499\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e, i.e. \u003cspan class\u003d\"tex-span\"\u003e7\u003c/span\u003e.\u003c/li\u003e\u003cli\u003e The strength of second ranger remains the same, i.e. \u003cspan class\u003d\"tex-span\"\u003e7\u003c/span\u003e.\u003c/li\u003e\u003cli\u003e The strength of third ranger is updated to \u003cimg align\u003d\"middle\" class\u003d\"tex-formula\" src\u003d\"CDN_BASE_URL/ca94cc2459ed50755900ea207578a509?v\u003d1715413499\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e, i.e. \u003cspan class\u003d\"tex-span\"\u003e11\u003c/span\u003e.\u003c/li\u003e\u003cli\u003e The strength of fourth ranger remains the same, i.e. \u003cspan class\u003d\"tex-span\"\u003e11\u003c/span\u003e.\u003c/li\u003e\u003cli\u003e The strength of fifth ranger is updated to \u003cimg align\u003d\"middle\" class\u003d\"tex-formula\" src\u003d\"CDN_BASE_URL/810c939821d2bd32d4073b4560ffc8d7?v\u003d1715413499\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e, i.e. \u003cspan class\u003d\"tex-span\"\u003e13\u003c/span\u003e.\u003c/li\u003e\u003c/ol\u003e The new strengths of the \u003cspan class\u003d\"tex-span\"\u003e5\u003c/span\u003e rangers are \u003cspan class\u003d\"tex-span\"\u003e[7, 7, 11, 11, 13]\u003c/span\u003e\u003cp\u003eNow, Jon wants to know the maximum and minimum strength of the rangers after performing the above operations \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ek\u003c/i\u003e\u003c/span\u003e times. He wants your help for this task. Can you help him?\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eFirst line consists of three integers \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e, \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ek\u003c/i\u003e\u003c/span\u003e, \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ex\u003c/i\u003e\u003c/span\u003e (\u003cspan class\u003d\"tex-span\"\u003e1 ≤ \u003ci\u003en\u003c/i\u003e ≤ 10\u003csup class\u003d\"upper-index\"\u003e5\u003c/sup\u003e\u003c/span\u003e, \u003cspan class\u003d\"tex-span\"\u003e0 ≤ \u003ci\u003ek\u003c/i\u003e ≤ 10\u003csup class\u003d\"upper-index\"\u003e5\u003c/sup\u003e\u003c/span\u003e, \u003cspan class\u003d\"tex-span\"\u003e0 ≤ \u003ci\u003ex\u003c/i\u003e ≤ 10\u003csup class\u003d\"upper-index\"\u003e3\u003c/sup\u003e\u003c/span\u003e) — number of rangers Jon has, the number of times Jon will carry out the operation and Jon\u0027s favourite number respectively.\u003c/p\u003e\u003cp\u003eSecond line consists of \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e integers representing the strengths of the rangers \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ea\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e1\u003c/sub\u003e, \u003ci\u003ea\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e2\u003c/sub\u003e, ..., \u003ci\u003ea\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/sub\u003e\u003c/span\u003e (\u003cspan class\u003d\"tex-span\"\u003e0 ≤ \u003ci\u003ea\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e ≤ 10\u003csup class\u003d\"upper-index\"\u003e3\u003c/sup\u003e\u003c/span\u003e).\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eOutput two integers, the maximum and the minimum strength of the rangers after performing the operation \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ek\u003c/i\u003e\u003c/span\u003e times.\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\n9 7 11 15 5\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e13 7\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\u003e2 100000 569\n605 986\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e986 605\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}