777
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

One day, Ks raised a question in this contest.

How many times the digit appears in the integer range of [0, n]?

The answer may be very large, please output the answer modulo .

输入描述:

First line contains an integer , indicating the count of questions.

Each of the following T lines contains one integer .


输出描述:

Output T lines, one number per line representing the answer.
示例1

输入

复制
10
940948
8
951
8152761
6322168
361892
254312334
8387
277931
56502860

输出

复制
566285
1
285
5870808
3758627
174579
197554663
3479
139247
38850866