Equanimous

아직 제출이 없습니다시간 제한2초메모리 제한256 MB

문제

Alice, Bob and Eve are playing a game on craft papers. Every time Eve tells a natural number, Alice and Bob can write the number (in the decimal representation) on their own papers, add a plus sign or a minus sign before each digit, and then evaluate the arithmetic expression he or she has wrote. The one with the lower absolute value wins. If their absolute values are the same, it will cause a draw and they will play one more time.

Actually, if they are smart, the game will never end. So after a while, they turn to focus on the optimal solution of the puzzle game. Let f(m)f(m) be the minimal absolute value that can be built from mm. They are wondering if you can help them determine f(m)f(m) for lmrl \leq m \leq r.

However, after realizing your perfect programming skill, they decided to make a puzzle for you as well. They have set several questions (l,r)(l, r) for you, and your task is to find the sum of all the integers mm between ll and rr (inclusive) satisfying f(m)=kf(m) = k for k=0,1,2,,9k = 0, 1, 2, \ldots, 9 and report the answer modulo (109+7)(10^9 + 7).

입력

The first line contains one integer nn (1n50001 \leq n \leq 5000) indicating the number of questions.

Each of the next nn lines contains two integers ll and rr (1lr101001 \leq l \leq r \leq 10^{100}) indicating a question.

출력

For each question, output ten space-separated integers in one line, where the ii-th integer indicates the sum of all the integers mm, satisfying that lmrl \leq m \leq r and f(m)=if(m) = i, modulo (109+7)(10^9 + 7).

힌트

The digits of 1926081719260817 in the decimal representation are 1,9,2,6,0,8,1,7\\{1, 9, 2, 6, 0, 8, 1, 7\\}, which can build an arithmetic expression (+1926+0+8+1+7)(+1-9-2-6+0+8+1+7), whose value and abosolute value are 00.

The digits of 1926081819260818 in the decimal representation are 1,9,2,6,0,8,1,8\\{1, 9, 2, 6, 0, 8, 1, 8\\}, which can build an arithmetic expression (+19+2+6081+8)(+1-9+2+6-0-8-1+8), whose value is 1-1 and aboslute value is 11.