cswork / OAOpen practice workspace

UberOA #40

First Unique Log Entry

Estimated EasyJudge-ready

Topics (AI-labelled)Hashing

Return the first full log line, in input order, that appears exactly once. Spaces are part of the log content; do not split into words or trim leading or trailing spaces. If there is no such line, output an empty line.

This site has made the standard input and output explicit.

Input

The first line contains n, followed by exactly n log lines, which may be empty. 1≤n≤1000000. This site's input protocol is at most 1MiB per line, only printable ASCII characters and spaces, and at most 32MiB for the whole standard input; logs contain no newlines.

Output

Output the full answer log followed by a newline; if there is no answer, output an empty line.

Example 1

Input:

5
A
B
A
C
B

Output:

C

Example 2

Input:

4
x
y
x
y

Output:

Example 3

Input:

3
a b
a
a b

Output:

a

Example notes

Example 1: A and B appear twice each and C once, so output C. Example 2: every log is repeated, so there is no result; output an empty line. Example 3: the full log a b is repeated, while a alone appears only once, so output a.

Editorial

Loading solution…