eolymp
bolt
Try our new interface for solving problems
Problems

Supersquare

Supersquare

Let number \textbf{A} be a \textit{precise square} if there exists natural number \textbf{B} such that \textbf{B*B = A}. \textbf{2n}-digit number without leading zeroes is called a \textit{supersquare} if it is a \textit{precise square} and both \textbf{n}-digit numbers which are formed from its \textbf{n} first digits and its \textbf{n} last digits are \textit{precise squares}. The second \textbf{n}-digit number \textbf{d_nd_\{n-1\}…d_1} formed from \textbf{n} last digits may have leading zeroes but must not be equal zero. \includegraphics{https://static.e-olymp.com/content/37/3784c8e3406216e5eb01b9c257bb2a264519af10.jpg} You need to write a program which constructs a \textbf{2n}-digit number which is \textit{supersquare}. \InputFile Input file contains several test cases. The first line contains the number of test cases \textbf{T} (\textbf{1} ≤ \textbf{T} ≤ \textbf{10}). Each of the next \textbf{T} lines describes one test case and contains an integer number \textbf{n} (\textbf{1} ≤ \textbf{n} ≤ \textbf{500}). \OutputFile Output file consists of \textbf{T} lines, one line per each test case. Each line contains \textbf{2n}-digit \textit{supersquare} number. If several solutions are possible only one of them should be given. When it is impossible to construct \textbf{2n}-digit \textit{supersquare}, the line must contain \textbf{NO SUPERSQUARE POSSIBLE} phrase.
Time limit 1 second
Memory limit 64 MiB
Input example #1
4
4
2
1
3
Output example #1
24019801
1681
49
225625
Source ACM Programming Contest 2005, Minsk, October 2005