Two course catalogs each tag their courses with lowercase keyword tags (letters, digits, and hyphens only). Given both tag lists, find the tags that appear in both catalogs.
Print the shared tags, each listed once, sorted in ascending lexicographic order, space-separated. If no tag is shared, print NONE.
Input format
Line 1: an integer n — the number of tags in catalog A.
Line 2: n space-separated tags.
Line 3: an integer m — the number of tags in catalog B.
Line 4: m space-separated tags.
Output format
The distinct shared tags, sorted ascending, space-separated on one line — or NONE if the two catalogs share no tag.
Constraints
- 1 ≤ n, m ≤ 1000
- Each tag has length 1-20 and consists only of lowercase letters, digits, and hyphens (
-).