#K66512. Find Palindromic Numbers

    ID: 32437 Type: Default 1000ms 256MiB

Find Palindromic Numbers

Find Palindromic Numbers

Given a positive integer n, find all the palindromic numbers in the range from 1 to n (inclusive). A palindromic number is a number that reads the same backward as forward. In mathematical terms, a number a is a palindrome if:

\(a = reverse(a)\)

Your task is to output all such palindromic numbers in ascending order, separated by a single space.

inputFormat

The input consists of a single integer n (\(1 \leq n \leq 10^5\)) provided via standard input (stdin).

outputFormat

Output all palindromic numbers from 1 to n (inclusive) in a single line, separated by spaces, via standard output (stdout).

## sample
10
1 2 3 4 5 6 7 8 9