{"trustable":true,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n #problem-body \u003e pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv id\u003d\"problem-body\"\u003e\n\t\u003cp\u003e \u003c/p\u003e\r\n\u003ctable class\u003d\"problems\" style\u003d\"width: 100%;\" border\u003d\"0\"\u003e\r\n\u003ctbody\u003e\r\n\u003ctr class\u003d\"navigation\"\u003e\r\n\u003ctd width\u003d\"50%\"\u003e\u003ca href\u003d\"https://www.spoj.com/problems/MCOINS/en/\"\u003eEnglish\u003c/a\u003e\u003c/td\u003e\r\n\u003ctd width\u003d\"50%\"\u003e\u003ca href\u003d\"https://www.spoj.com/problems/MCOINS/vn/\"\u003eVietnamese\u003c/a\u003e\u003c/td\u003e\r\n\u003c/tr\u003e\r\n\u003c/tbody\u003e\r\n\u003c/table\u003e\r\n\r\n\u003cp\u003eAsen and Boyan are playing the following game. They choose two different positive integers K and L, and start the game with a tower of N coins. Asen always plays first, Boyan – second, after that – Asen again, then Boyan, and so on. The boy in turn can take 1, K or L coins from the tower. The winner is the boy, who takes the last coin (or coins). After a long, long playing, Asen realizes that there are cases in which he could win, no matter how Boyan plays. And in all other cases Boyan being careful can win, no matter how Asen plays.\u003c/p\u003e\r\n\u003cp\u003e\r\nSo, before the start of the game Asen is eager to know what game case they have. Write a program coins which help Asen to predict the game result for given K, L and N.\r\n\u003c/p\u003e\r\n\r\n\u003ch3\u003eINPUT\u003c/h3\u003e\r\n\u003cp\u003eThe input describes m games.\u003c/p\u003e\r\n\u003cp\u003eThe first line of the standard input contains the integers K, L and m, 1 \u0026lt; K \u0026lt; L \u0026lt; 10, 3 \u0026lt; m \u0026lt; 50. The second line contains m integers N1, N2 … Nm, 1 ≤ Ni ≤ 1 000 000, i \u003d 1, 2 … m, representing the number of coins in each of the m towers\u003c/p\u003e\r\n\r\n\u003cpre\u003eSAMPLE INPUT\u003cbr\u003e2 3 5 \u003cbr\u003e3 12 113 25714 88888\u003c/pre\u003e\r\n\r\n\u003ch3\u003eOUTPUT\u003c/h3\u003e\r\n\u003cp\u003eThe standard output contains a string of length m composed of letters A and B. If Asen wins the ith game (no matter how the opponent plays), the ith letter of the string has to be A. When Boyan wins the ith game (no matter how Asen plays), the ith letter of the string has to be B.\u003c/p\u003e\r\n\r\n\u003cpre\u003eSAMPLE OUTPUT\u003cbr\u003eABAAB\u003cbr\u003e\u003c/pre\u003e\r\n\u003cp\u003e\u003cstrong\u003eProblem for kid - Please, think like kid.\u003c/strong\u003e \u003c/p\u003e\n\u003c/div\u003e"}}]}