#P1380F. Strange Addition
Strange Addition
No submission language available for this problem.
Description
Let and be some non-negative integers. Let's define strange addition of and as following:
- write down the numbers one under another and align them by their least significant digit;
- add them up digit by digit and concatenate the respective sums together.
Assume that both numbers have an infinite number of leading zeros.
For example, let's take a look at a strange addition of numbers and :

You are given a string , consisting of digits from to . You are also given updates of form:
- — replace the digit at the -th position of with a digit .
Note that string might have leading zeros at any point of time.
After each update print the number of pairs such that both and are non-negative integers and the result of a strange addition of and is equal to .
Note that the numbers of pairs can be quite large, so print them modulo .
The first line contains two integers and () — the length of the number and the number of updates.
The second line contains a string , consisting of exactly digits from to .
Each of the next lines contains two integers and (, ) — the descriptions of updates.
Print integers — the -th value should be equal to the number of pairs such that both and are non-negative integers and the result of a strange addition of and is equal to after updates are applied.
Note that the numbers of pairs can be quite large, so print them modulo .
Input
The first line contains two integers and () — the length of the number and the number of updates.
The second line contains a string , consisting of exactly digits from to .
Each of the next lines contains two integers and (, ) — the descriptions of updates.
Output
Print integers — the -th value should be equal to the number of pairs such that both and are non-negative integers and the result of a strange addition of and is equal to after updates are applied.
Note that the numbers of pairs can be quite large, so print them modulo .
Samples
Note
After the first update is equal to . The pairs that sum up to are: , , , , , , , , , , , , , , .
After the second update is equal to .
After the third update is equal to .