N = int(input()) M = int(input()) ans = [] while M > 0: ans.append( M // N ) M %= N ans.reverse() print ("".join(map(str,ans)))