s=input().split() a=int(s[0]) b=int(s[1]) s="" for i in range(0,a): s+=str(i+1) print(int(s)%b)
TLE一片,求解决之道