#arc111a. [arc111_a]Simple Math 2

[arc111_a]Simple Math 2

Problem Statement

Given positive integers NN and MM, find the remainder when lfloorfrac10NMrfloor\\lfloor \\frac{10^N}{M} \\rfloor is divided by MM.

What is lfloorxrfloor\\lfloor x \\rfloor? lfloorxrfloor\\lfloor x \\rfloor denotes the greatest integer not exceeding xx. For example:

  • lfloor2.5rfloor=2\\lfloor 2.5 \\rfloor = 2
  • lfloor3rfloor=3\\lfloor 3 \\rfloor = 3
  • lfloor9.9999999rfloor=9\\lfloor 9.9999999 \\rfloor = 9
  • $\\lfloor \\frac{100}{3} \\rfloor = \\lfloor 33.33... \\rfloor = 33$

Constraints

  • 1leqNleq10181 \\leq N \\leq 10^{18}
  • 1leqMleq100001 \\leq M \\leq 10000

Input

Input is given from Standard Input in the following format:

NN MM

Output

Print the answer.


Sample Input 1

1 2

Sample Output 1

1

We have lfloorfrac1012rfloor=5\\lfloor \\frac{10^1}{2} \\rfloor = 5, so we should print the remainder when 55 is divided by 22, that is, 11.


Sample Input 2

2 7

Sample Output 2

0

Sample Input 3

1000000000000000000 9997

Sample Output 3

9015