#P1380F. Strange Addition

    ID: 1385 Type: RemoteJudge 5000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>data structuresdpmatrices*2600

Strange Addition

No submission language available for this problem.

Description

Let aa and bb be some non-negative integers. Let's define strange addition of aa and bb as following:

  1. write down the numbers one under another and align them by their least significant digit;
  2. 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 32483248 and 908908:

You are given a string cc, consisting of nn digits from 00 to 99. You are also given mm updates of form:

  • x dx~d — replace the digit at the xx-th position of cc with a digit dd.

Note that string cc might have leading zeros at any point of time.

After each update print the number of pairs (a,b)(a, b) such that both aa and bb are non-negative integers and the result of a strange addition of aa and bb is equal to cc.

Note that the numbers of pairs can be quite large, so print them modulo 998244353998244353.

The first line contains two integers nn and mm (1n,m51051 \le n, m \le 5 \cdot 10^5) — the length of the number cc and the number of updates.

The second line contains a string cc, consisting of exactly nn digits from 00 to 99.

Each of the next mm lines contains two integers xx and dd (1xn1 \le x \le n, 0d90 \le d \le 9) — the descriptions of updates.

Print mm integers — the ii-th value should be equal to the number of pairs (a,b)(a, b) such that both aa and bb are non-negative integers and the result of a strange addition of aa and bb is equal to cc after ii updates are applied.

Note that the numbers of pairs can be quite large, so print them modulo 998244353998244353.

Input

The first line contains two integers nn and mm (1n,m51051 \le n, m \le 5 \cdot 10^5) — the length of the number cc and the number of updates.

The second line contains a string cc, consisting of exactly nn digits from 00 to 99.

Each of the next mm lines contains two integers xx and dd (1xn1 \le x \le n, 0d90 \le d \le 9) — the descriptions of updates.

Output

Print mm integers — the ii-th value should be equal to the number of pairs (a,b)(a, b) such that both aa and bb are non-negative integers and the result of a strange addition of aa and bb is equal to cc after ii updates are applied.

Note that the numbers of pairs can be quite large, so print them modulo 998244353998244353.

Samples

Sample Input 1

2 3
14
2 4
2 1
1 0

Sample Output 1

15
12
2

Note

After the first update cc is equal to 1414. The pairs that sum up to 1414 are: (0,14)(0, 14), (1,13)(1, 13), (2,12)(2, 12), (3,11)(3, 11), (4,10)(4, 10), (5,9)(5, 9), (6,8)(6, 8), (7,7)(7, 7), (8,6)(8, 6), (9,5)(9, 5), (10,4)(10, 4), (11,3)(11, 3), (12,2)(12, 2), (13,1)(13, 1), (14,0)(14, 0).

After the second update cc is equal to 1111.

After the third update cc is equal to 0101.