Universal Cup Judging System

Universal Cup

Límite de tiempo: 3.0 s Límite de memoria: 1024 MB Puntuación total: 100 Hackeable ✓
Estadísticas

You are given a string $S$ of length $N$ consisting of the digits $1, 2, \dots, 9$.

Consider a triangular pyramid made up of a total of $\frac{N(N+1)}{2}$ blocks.

The pyramid is divided into $N$ layers, numbered $1, 2, \dots, N$ from top to bottom. Layer $i$ ($1 \le i \le N$) contains $i$ blocks arranged in a single horizontal row from left to right. Each block has a string written on it. Let $C_{i,j}$ denote the string written on the $j$-th block from the left ($1 \le j \le i$) in layer $i$.

The strings $C_{i,j}$ satisfy the following conditions:

  • If $i = N$, then $C_{i,j}$ is the string of length $1$ consisting of the $j$-th character of $S$.
  • If $1 \le i < N$, then $C_{i,j}$ is the concatenation of $C_{i+1,j}$ and $C_{i+1,j+1}$, in this order.

Interpret $C_{1,1}$ as a decimal integer, and compute its value modulo $998244353$.

Input

The input is given in the following format:

N
S
  • $N$ is an integer.
  • $1 \le N \le 2 \times 10^5$.
  • $S$ is a string of length $N$ consisting of the digits $1, 2, \dots, 9$.

Output

Output the answer.

Examples

Input 1

4
8192

Output 1

81191992

Input 2

1
5

Output 2

5

Input 3

14
11123455678999

Output 3

913063116

Note

In the first example, $S = 8192$. By constructing the pyramid according to the rules, we obtain $C_{1,1} = 81191992$.

problem_16231_1.png

In the second example, $S = 5$. The pyramid consists of a single block, and $C_{1,1} = 5$.

problem_16231_2.png

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.