#K91412. Frequent Product Finder

    ID: 37970 Type: Default 1000ms 256MiB

Frequent Product Finder

Frequent Product Finder

You are given a list of product transactions. Your task is to determine the product that was purchased the most number of times. In case of a tie, return the product which is lexicographically smallest. The comparison is case-sensitive (i.e. uppercase letters come before lowercase letters in lexicographical order).

Note: If there are no transactions, output an empty string.

Formally, if the frequency of product p is \(f(p)\) for each product p, you need to output the product \(p^*\) such that \[ p^* = \min\{ p : f(p) = \max_{q} f(q) \} \] where the minimum is taken in lexicographical order.

inputFormat

The first line contains a single integer \(T\) representing the number of transactions.

The following \(T\) lines each contain a non-empty string that denotes the name of the product purchased in that transaction.

If \(T = 0\), then there are no transactions.

outputFormat

Output a single line containing the product that is purchased most frequently. If there are multiple products with the same purchase frequency, output the lexicographically smallest one.

If there are no transactions, output an empty string.

## sample
1
apple
apple