n,b=map(int,raw_input().split()) K=10**100 n*=K s='' exec"c=0\nwhile n>b*K:n/=b;c+=1\ns+=`c`+'.'[len(s):];n=n**10/K**9;"*101 print s