#K95912. Find Palindrome Words

    ID: 38969 Type: Default 1000ms 256MiB

Find Palindrome Words

Find Palindrome Words

Your task is to write a program that reads a list of words and outputs only those words that are palindromes. A palindrome is a word that reads the same backwards and forwards. In mathematical terms, a word w is a palindrome if \( w = \text{reverse}(w) \).

If no palindrome words are found, output an empty line.

inputFormat

The input is given via standard input (stdin) and consists of:

  1. The first line contains an integer \(n\) representing the number of words.
  2. The second line contains \(n\) words separated by spaces.

outputFormat

Output a single line to standard output (stdout) containing the palindrome words in the order they appear, separated by a single space. If there are no palindrome words, output an empty line.

## sample
5
racecar hello madam world level
racecar madam level