#K52457. Blue Wooden Gate

    ID: 29313 Type: Default 1000ms 256MiB

Blue Wooden Gate

Blue Wooden Gate

You are given a list of words. A word is said to pass through the blue wooden gate if it contains at least one repeating letter. In other words, there exists a letter that appears at least twice in the word. Formally, for a given word \( w \) of length \( n \), there exists an index pair \( (i, j) \) with \( 1 \leq i < j \leq n \) such that \( w_i = w_j \).

Your task is to filter the given words and output only those words that can pass through the gate. The order of the words should be preserved.

Example:

  • Input: balloon apple orange peach banana
  • Output: balloon apple banana

inputFormat

The input is read from standard input (stdin) and consists of two lines:

  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, to standard output (stdout), the words that can pass through the blue wooden gate separated by a single space. If no word qualifies, output an empty line.

## sample
5
balloon apple orange peach banana
balloon apple banana