def decompress_string(S): T = '' for i in range(8): if i % 2 == 0: T += S[i] else: if S[i] == '2': T = T + T return T def kth_smallest_string(K): compressed_strings = ['N1U1P1C1', 'N1U1P1C2', 'N1U1P2C1', 'N1U1P2C2', 'N1U2P1C1', 'N1U2P1C2', 'N1U2P2C1', 'N1U2P2C2', 'N2U1P1C1', 'N2U1P1C2', 'N2U1P2C1', 'N2U1P2C2', 'N2U2P1C1', 'N2U2P1C2', 'N2U2P2C1', 'N2U2P2C2'] decompressed_strings = [decompress_string(S) for S in compressed_strings] decompressed_strings.sort() return decompressed_strings[K-1] K = int(input()) print(kth_smallest_string(K))