Codeforces Round 206 (Div. 2)
A
Vasya and Digital Root
Codeforces
1100
原题
←B →
翻译中…

Vasya has recently found out what a digital root of a number is and he decided to share his knowledge with you.

翻译中…

Let's assume that $*S*(*n*)$ is the sum of digits of number $*n*$, for example, $*S*(4098) = 4 + 0 + 9 + 8 = 21$. Then the digital root of number $*n*$ equals to:

翻译中…
  1. $*dr*(*n*) = *S*(*n*)$, if $*S*(*n*) < 10$;
  2. $*dr*(*n*) = *dr*( *S*(*n*) )$, if $*S*(*n*) ≥ 10$.
翻译中…

For example, $*dr*(4098)  =  *dr*(21)  =  3$.

翻译中…

Vasya is afraid of large numbers, so the numbers he works with are at most $10^{1000}$. For all such numbers, he has proved that $*dr*(*n*)  =  *S*( *S*( *S*( *S*(*n*) ) ) )$ $(*n* ≤ 10^{1000})$.

翻译中…

Now Vasya wants to quickly find numbers with the given digital root. The problem is, he hasn't learned how to do that and he asked you to help him. You task is, given numbers $*k*$ and $*d*$, find the number consisting of exactly $*k*$ digits (the leading zeroes are not allowed), with digital root equal to $*d*$, or else state that such number does not exist.

翻译中…

Input

翻译中…

The first line contains two integers $*k*$ and $*d*$ $(1 ≤ *k* ≤ 1000; 0 ≤ *d* ≤ 9)$.

翻译中…

Output

翻译中…

In a single line print either any number that meets the requirements (without the leading zeroes) or "No solution" (without the quotes), if the corresponding number does not exist.

翻译中…

The chosen number must consist of exactly $*k*$ digits. We assume that number 0 doesn't contain any leading zeroes.

翻译中…

Note

翻译中…

For the first test sample $*dr*(5881)  =  *dr*(22)  =  4$.

翻译中…

For the second test sample $*dr*(36172)  =  *dr*(19)  =  *dr*(10)  =  1$.

翻译中…

样例

Input #1
4 4
Output #1
5881
InputCopy OutputCopy
Input #2
5 1
Output #2
36172
InputCopy OutputCopy
Input #3
1 0
Output #3
0
InputCopy OutputCopy
题目信息
题号
355A
时间限制
1 s
内存限制
256 MB
标签
构造
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。