#C4906. Largest Palindrome Product

    ID: 48496 Type: Default 1000ms 256MiB

Largest Palindrome Product

Largest Palindrome Product

You are given a positive integer n. Your task is to find the largest palindromic number that can be obtained as a product of two n-digit numbers. An n-digit number is any integer between \(10^{n-1}\) and \(10^n - 1\) (inclusive). A palindromic number is a number that remains the same when its digits are reversed.

For example, when n = 2, the two-digit numbers lie between 10 and 99, and the largest palindrome product of two of these numbers is 9009.

Your program should read the input from stdin and output the result to stdout.

inputFormat

The input consists of a single line containing one integer n (1 ≤ n ≤ 8), which represents the number of digits for the factors.

outputFormat

Output the largest palindrome number that is a product of two n-digit numbers. The output should be printed to stdout.## sample

1
9