#abc357d. D - 88888888

D - 88888888

Score : 350350 points

问题陈述

对于一个正整数 NN,让 VNV_N 是通过将 NN 连接 NN 次形成的整数。 更精确地说,将 NN 视为一个字符串,连接 NN 个副本,并将结果视为一个整数以得到 VNV_N。 例如,V3=333V_3=333V10=10101010101010101010V_{10}=10101010101010101010

找出 VNV_N 除以 998244353998244353 时的余数。

以上为大语言模型 kimi 翻译,仅供参考。

Problem Statement

For a positive integer NN, let VNV_N be the integer formed by concatenating NN exactly NN times.
More precisely, consider NN as a string, concatenate NN copies of it, and treat the result as an integer to get VNV_N.
For example, V3=333V_3=333 and V10=10101010101010101010V_{10}=10101010101010101010.

Find the remainder when VNV_N is divided by 998244353998244353.

Constraints

  • 1N10181 \leq N \leq 10^{18}
  • NN is an integer.

Input

The input is given from Standard Input in the following format:

NN

Output

Print the remainder when VNV_N is divided by 998244353998244353.

Sample Input 1

5

Sample Output 1

55555

The remainder when V5=55555V_5=55555 is divided by 998244353998244353 is 5555555555.

Sample Input 2

9

Sample Output 2

1755646

The remainder when V9=999999999V_9=999999999 is divided by 998244353998244353 is 17556461755646.

Sample Input 3

10000000000

Sample Output 3

468086693

Note that the input may not fit into a 3232-bit integer type.