n=int(input("введите число "))
m=int(input("введите основание сист. счисдения "))
s=''
while n>0:
ost=n%m
if ost==10:
ost='a'
if ost==11:
ost='b'
if ost==12:
ost='c'
if ost==13:
ost='d'
if ost==14:
ost='e'
if ost==15:
ost='f'
n=n//m
s+=str(ost)
s=s[::-1]
print('ответ: ',s," в ",m,' системе счисления ')