#B4088. Find the Largest Palindrome Number

    ID: 11745 Type: Default 1000ms 256MiB

Find the Largest Palindrome Number

Find the Largest Palindrome Number

A palindrome number is a number that reads the same backward as forward, for example, \(1221\) and \(1234321\) are palindromic, whereas \(1234\) is not.

You are given \(n\) positive integers \(a_i\) for \(i = 0, 1, 2, \dots, n-1\). Your task is to find the largest palindrome among them.

inputFormat

The first line contains an integer \(n\) representing the number of integers. The second line contains \(n\) space-separated positive integers \(a_i\).

outputFormat

Output the largest palindrome number from the given list.

sample

5
121 12321 432 4554 67
12321