Given a sequence of integers and a specified base (2 \leq p \leq 16), determine the digit that occurs most frequently in the base- representations of the sequence members. If there is a tie for the most frequent digit, output the smallest such digit.
The input begins with the value , followed by the members of the sequence. All input numbers are given in decimal form.
Output a single line containing the digit that appears most frequently in the base- representations of the sequence members. The digit should be presented in base-, using uppercase Latin letters when necessary.
Example 1