— I experienced so many great things.

— You gave me memories like dreams... But I have to leave now...

— One last request, can you...

— Help me solve a Codeforces problem?

— ......

— What?

Chtholly has been thinking about a problem for days:

If a number is palindrome and length of its decimal representation without leading zeros is even, we call it a zcy number. A number is palindrome means when written in decimal representation, it contains no leading zeros and reads the same forwards and backwards. For example 12321 and 1221 are palindromes and 123 and 12451 are not. Moreover, 1221 is zcy number and 12321 is not.

Given integers *k* and *p*, calculate the sum of the *k* smallest zcy numbers and output this sum modulo *p*.

Unfortunately, Willem isn't good at solving this kind of problems, so he asks you for help!
The first line contains two integers *k* and *p* (1 ≤ *k* ≤ 10<sup class="upper-index">5</sup>, 1 ≤ *p* ≤ 10<sup class="upper-index">9</sup>).
In the first example, the smallest zcy number is 11, and the second smallest zcy number is 22.

In the second example, <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/68fffad54395f7d920ad0384e07c6215ddc64141.png" style="max-width: 100.0%;max-height: 100.0%;"/>.
2 100
33
5 30
15
42147 412393322
251637727
77809 868097296
440411873
5105 443422097
363192634
75615 376679484
373089399
22951 23793302
1898631
12785 993582106
286204743
60276 428978808
376477293
84776 104860385
10209596
41984 653766991
17823101
100000 1000000000
495495496
41163 472310076
207304047
6983 765352180
586866999
33493 967727004
305705165
90898 94010922
65928728
67298 349286579
156435206
92452 296773064
229486976
58832 563860457
16775206
90234 156145441
44023160
91454 977186148
681779748
11108 444095250
188075844
46304 584475527
275627129
1 1
0
1 1000000000
11
100000 1
0
k,p= map (int, input().split())

sum=0
cnt=2
count=0
i=1

for x in range (1,k+1):
	sum=(sum+int(str(x)+str(x)[::-1]))%p
print(sum%p)
