#!/usr/bin/env python3 """ If all bases 16..2 fail, print the answer in unary, using 0 as the digit """ year = int(input().split()[0]) for b in range(16, 1, -1): if year % (b * b) == 0: res = "" while year: res += f"{year % b:x}" year //= b print(b, res[::-1]) break else: print("0" * year)