#K45787. Palindromic Numbers Finder
Palindromic Numbers Finder
Palindromic Numbers Finder
You are given a list of integers. Your task is to find and output all palindromic numbers from the given list. A number is considered palindromic if its decimal representation reads the same forwards and backwards. Formally, for a number \( x \) with string representation \( s \), it is palindromic if \( s = s^R \), where \( s^R \) is the reverse of \( s \). Note that negative numbers are not considered palindromic since the minus sign affects the symmetry.
Example: For the input list [121, 123, 454, 567], the palindromic numbers are 121 and 454.
inputFormat
The input is read from standard input (stdin) and contains two lines. The first line contains a single integer \( n \) representing the number of integers in the list. The second line contains \( n \) integers separated by spaces.
\(1 \leq n \leq 10^5\), and each integer fits in a 32-bit signed integer.
outputFormat
Output to standard output (stdout) all the palindromic numbers found in the list in their original order, separated by a single space. If there are no palindromic numbers, output an empty line.
## sample4
121 123 454 567
121 454