AT_arc202_c [ARC202C] Repunits

Description

For a positive integer $ n $ , define $ R_n $ as "the integer obtained by interpreting a string of $ n $ consecutive $ 1 $ s as a decimal number". For example, $ R_3 = 111 $ . You are given a positive integer sequence $ A = (A_1, A_2, \dots, A_N) $ . For $ k = 1, 2, \dots, N $ , calculate $ \mathrm{LCM}(R_{A_1}, R_{A_2}, \dots, R_{A_k}) \bmod 998244353 $ . Here, $ \mathrm{LCM} $ is the function that calculates the least common multiple.

Input Format

The input is given from Standard Input in the following format: > $ N $ $ A_1 $ $ A_2 $ $ \dots $ $ A_N $

Output Format

Output $ N $ lines. The $ k $ -th line should contain $ \mathrm{LCM}(R_{A_1}, R_{A_2}, \dots, R_{A_k}) \bmod 998244353 $ .

Explanation/Hint

### Sample Explanation 1 For $ k=1 $ , $ \mathrm{LCM}(11) \bmod 998244353 = 11 $ . For $ k=2 $ , $ \mathrm{LCM}(11,1111) \bmod 998244353= 1111 $ . For $ k=3 $ , $ \mathrm{LCM}(11,1111,111111) \bmod 998244353= 11222211 $ . ### Constraints - $ 1 \leq N \leq 2 \times 10^5 $ - $ 1 \leq A_i \leq 2 \times 10^5 $ - All input values are integers.