More than anyone#729

More than anyone

1 second
256 megabytes
Easy

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.

Input

The input begins with the value , followed by the members of the sequence. All input numbers are given in decimal form.

Output

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.

Examples

Example 1

Loading
Loading