cswork / OA打开练习工作台

AmazonOA #187

Find Recurring Names

估计简单可在线判题

考点(AI 标注)哈希计数字符串

No two real names are anagrams of each other, and every registered name is an anagram of some real name. Find the real names registered more than 1 time and output them in lexicographic order; if there are none, output None. Repeated identical registered names each count as a separate account.

输入格式

The first line contains n m, followed by n lines of real names and m lines of registered names. 1≤n,m≤100000; each name has length 1..10 and contains only lowercase letters; real names are distinct and no two are anagrams of each other.

输出格式

Output on one line, in lexicographic order, the real names that were registered repeatedly, separated by spaces; if there are none, output None.

样例 1

输入:

3 3
rohn
henry
daisy
ryhen
aisyd
henry

输出:

henry

样例 2

输入:

2 5
tom
jerry
reyjr
mot
tom
jerry
mto

输出:

jerry tom

样例 3

输入:

1 1
abc
bca

输出:

None

样例说明

The answers are henry; jerry tom; None.