#K1791. Find the First String with Repeating Characters

    ID: 24593 Type: Default 1000ms 256MiB

Find the First String with Repeating Characters

Find the First String with Repeating Characters

You are given a list of n strings. Your task is to find the first string (in the order given) that contains at least one repeating character. A character is considered repeating if it appears at least twice in that string.

If no such string exists, output an empty string.

Formally, for a string s, find if there exist indices \(i\) and \(j\) such that \(s_i = s_j\) and \(i \neq j\). Return the first string satisfying the condition. Otherwise, return an empty string.

inputFormat

The first line contains an integer n indicating the number of strings.

The following n lines each contain a non-empty string (or an empty string) consisting of characters.

outputFormat

Output the first string that has at least one repeating character. If no such string exists, output an empty string.

## sample
4
abcdef
aabbcc
xyz
mnop
aabbcc