f=lambda a,b:a and f(a/b,b)*10+a%b while 1:print f(*map(int,raw_input().split()))