{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":" \u003cp\u003eOnce upon a time, there lived a chimpanzee called Luchu Monke (aka Playboy Monke). \u003c/p\u003e\u003ccenter\u003e\u003ca href\u003d\u0027https://postimages.org/\u0027 target\u003d\u0027_blank\u0027\u003e\u003cimg src\u003d\u0027https://i.postimg.cc/SKdnPbcY/monke.jpg\u0027 border\u003d\u00270\u0027 alt\u003d\u0027monke\u0027/\u003e\u003c/a\u003e\u003c/center\u003e\u003cp\u003eLuchu was unhappily married to Bunty Mona, a short but cute little lady chimp. Luchu was tall and handsome — he was feeling uncomfortable taking Bunty to public places with him. People would stare at them all the time. At one point, Luchu could not stand it anymore, and he decided to do some justice to his name. He started looking for a new hope at the Lady Chimps’ High School. Every day, Luchu would climb up a bamboo tree and wait for the morning drill to start. From there, he could see each and every lady chimp doing their routine drill. Now, Luchu was looking for the tallest lady chimp that would be shorter than him; he would also like to consider someone a little taller than him. But someone of his height will never be on his list. Every morning, Luchu picks up a line of lady chimps and finds the best two according to his set criteria. His job has been made easy by the fact that the lady chimps in each line are ordered by their height, the shortest one is in the front and the tallest one is at the back. Your task is to help Luchu on one particular day find two lady chimps: the tallest one shorter than him and the shortest one taller than him.\n "}},{"title":"Input","value":{"format":"HTML","content":"There will be only one set of input for this problem. The first line of input gives you a number N (1 ≤ N ≤ 50000), the number of lady chimps on\nthe line. In the next line you would have N integers (in the range 1 to 2\u003csup\u003e31\u003c/sup\u003e − 1 giving the heights of\nthe N chimps. There would be a single space after every number. You can assume that the chimps\nare ordered in non-decreasing order of their heights. In the next line you would have an integer Q\n(1 ≤ Q ≤ 25000) giving the number of queries. Then in the next line Q queries will follow. Then you\nwould have Q numbers giving the height of Luchu! Dont worry, Luchu is from the land where people\ncan have 3 birthdates; Q heights for a chimpanzee will make no difference here. The Q numbers are\nlisted on a line and their range from 1 to 2\u003csup\u003e31\u003c/sup\u003e − 1, and as before you would find a single space after\nevery query number. The query numbers are not supposed to come in any particular order."}},{"title":"Output","value":{"format":"HTML","content":"For each query height, print two numbers in one line. The first one would be the height of the tallest\nlady chimp that is shorter than Luchu, and the next number would be the height of the shortest lady\nchimp that is taller than he. These two numbers are to be separated by a single space. Whenever it is\nimpossible to find any of these two heights, replace that height with an uppercase ‘X’.\n"}},{"title":"Sample-1","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\u003e\n4\n1 4 5 7\n4\n4 6 8 10\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e\n1 5\n5 7\n7 X\n7 X\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}