#P294. 【例49.1】回文平方数

【例49.1】回文平方数

Description

A palindrome number reads the same from left to right and right to left. For example, 1232112321 is a typical palindrome number.
Given a base BB (2B202≤B≤20, represented in decimal), output all numbers greater than or equal to 11 and less than or equal to 300300 (in decimal) whose squares are palindromes when represented in base BB. Use AA, BB, etc. to represent 1010, 1111, etc.

Input Format

A single line containing an integer BB (represented in decimal).

Output Format

Each line contains two numbers in base BB that meet the requirements, where the second number is the square of the first number and is a palindrome.

Sample

10
1 1
2 4
3 9
11 121
22 484
26 676
101 10201
111 12321
121 14641
202 40804
212 44944
264 69696