- while문을 돌며 a가 0이 될 때 까지 나머지에 해당하는 index값을 std에서 찾아 res에 append한 후 print함.
def solution() :
a, b = map(int, input().split())
std = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
res = []
while a != 0 :
res.append(str(std[a % b]))
a //= b
print(''.join(res)[::-1])
solution()