#K10736. Finding the First Palindrome

    ID: 23313 Type: Default 1000ms 256MiB

Finding the First Palindrome

Finding the First Palindrome

Given a list of words, your task is to find the first word that is a palindrome. A palindrome is a word that reads the same forward and backward, i.e., \( word = word^{\text{reversed}} \). If there is no palindrome in the list, output no palindrome.

For example, if the input list is ['apple', 'banana', 'racecar', 'mango'], the output should be racecar because it is the first palindrome in the list.

inputFormat

The input is given from standard input (stdin). The first line contains an integer ( n ) indicating the number of words. The second line contains ( n ) words separated by spaces.

outputFormat

Output to standard output (stdout) the first palindrome found in the list. If there is no palindrome, output no palindrome.## sample

4
apple banana racecar mango
racecar