def ten_to_6(x):
output = ""

ret = x/6
leave = x%6

if ret == 0:
return str(leave)
xxx = ten_to_6(ret)
output = xxx + str(leave)


return output



print ten_to_6(265)