# global definition
# base = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F]
base = [str(x) for x in range(10)] + [ chr(x) for x in range(ord('A'),ord('A')+6)]
def dec2bin(num):
mid = [0,0,0,0,0,0,0,0]
i = 0
while True:
if num == 0: break
num,rem = divmod(num, 2)
mid = base[rem]
i = i + 1