#K12736. Mirror Words

    ID: 23757 Type: Default 1000ms 256MiB

Mirror Words

Mirror Words

Given a list of words, your task is to find pairs of words that are mirror images of each other. Two words are considered mirrors if one is the reverse of the other. Each word can be used in at most one pair. If mirror pairs exist, output each pair on a new line with the two words separated by a space, in the order they were found. If no mirror pairs exist, simply output No mirror words found.

Input Format: The first line contains the integer \(n\) (the number of words). This is followed by \(n\) lines, each containing a single word.

Output Format: If mirror pairs exist, each line should contain two words (separated by a space) forming a mirror pair. Otherwise, output No mirror words found.

inputFormat

The first line contains an integer \(n\) representing the number of words. The following \(n\) lines each contain one word.

outputFormat

For each mirror pair, output a line with the two words separated by a space. If no mirror pairs exist, output No mirror words found.

## sample
5
abc
cba
xyz
zyx
def
abc cba

xyz zyx

</p>