Reverse
题号:NC52807
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 32 M,其他语言64 M
Special Judge, 64bit IO Format: %lld

题目描述

Bobo has a n digits decimal number (It may have leading zeros).
Let R(i, j) denotes number D with digits between the i-th position and j-th position reversed. That is, .
Bobo would like to find modulo .

输入描述:

The input contains at most 30 sets. For each set:
The first line contains an integer n ().
The second line contains n digits .

输出描述:

For each set, an integer denotes the result
示例1

输入

复制
2
12

输出

复制
45
示例2

输入

复制
3
012

输出

复制
369
示例3

输入

复制
10
0123456789

输出

复制
733424314