We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.
Print all strings that are written on the most number of votes, in lexicographical order.

-----Constraints-----
 - 1 \leq N \leq 2 \times 10^5
 - S_i (1 \leq i \leq N) are strings consisting of lowercase English letters.
 - The length of S_i (1 \leq i \leq N) is between 1 and 10 (inclusive).

-----Input-----
Input is given from Standard Input in the following format:
N
S_1
:
S_N

-----Output-----
Print all strings in question in lexicographical order.

-----Sample Input-----
7
beat
vet
beet
bed
vet
bet
beet

-----Sample Output-----
beet
vet

beet and vet are written on two sheets each, while beat, bed, and bet are written on one vote each. Thus, we should print the strings beet and vet.
[{"code": "from collections import Counter\nn = int(input())\nss = [input() for _ in range(n)]\nss.sort()\nc = Counter()\nmc = 0\nfor s in ss:\n  c[s] += 1\n  mc = max(mc, c[s])\nseen = set()\nfor s in ss:\n  if c[s] == mc and s not in seen:\n    print(s)\n    seen.add(s)", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "n = int(input())\ns_l = [ input() for _ in range(n) ]\n\nd = {}\nfor s in s_l:\n    try:\n        d[s] += 1\n    except:\n        d[s] = 1\n\nmax_c = max([ v for _,v in d.items() ])\nans = [ i for i, v in d.items() if v == max_c ]\n\nfor i in sorted(ans):\n    print(i)", "passed": true, "time": 0.23, "memory": 14204.0, "status": "done"}, {"code": "N = int(input())\nd = {}\nfor _ in range(N):\n  p = input()\n  if p in d:\n    d[p] += 1\n  else:\n    d[p] = 1\nma = max(d.values())\nd2 = sorted(d.items())\nd.clear()\nd.update(d2)\nfor k, v in list(d.items()):\n  if v == ma:\n    print(k)\n", "passed": true, "time": 0.2, "memory": 14056.0, "status": "done"}, {"code": "import collections\nn=int(int(input()))\na=[input() for i in range(n)]\nm = collections.Counter(a).most_common() \nprint('\\n'.join(sorted([a for a,b in m if b==m[0][1]])))", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "import collections\ndef i_input(): return int(input())\ndef i_map(): return list(map(int, input().split()))\ndef i_list(): return list(map(int, input().split()))\ndef i_row(N): return [int(input()) for _ in range(N)]\ndef i_row_list(N): return [list(input().split()) for _ in range(N)]\n\nn=i_input()\nss=[input() for _ in range(n)]\nss.sort()\n\ncss=collections.Counter()\nfor s in ss:\n    css[s]+=1\nmaxapper=max(css.values())\n\nfor w in css:\n    if css[w]==maxapper:\n        print(w)\n\n\n\n", "passed": true, "time": 0.15, "memory": 14120.0, "status": "done"}, {"code": "n=int(input())\ndic={}\nfor i in range(n):\n    s=input()\n    if not s in dic:\n        dic[s]=1\n    else:\n        dic[s]+=1\nmax_val=max(dic.values())\na=sorted([i for i, k in dic.items() if k == max_val])\nfor i in a:\n    print(i)", "passed": true, "time": 0.2, "memory": 14176.0, "status": "done"}, {"code": "n = int(input())\nS = {}\nfor i in range(n):\n    s = input()\n    if s not in S.keys():\n        S[s] = 1\n    else:\n        S[s] += 1\nm = max(S.values())\nans = []\n\nfor key, value in S.items():\n    if value == m:\n        ans.append(key)\nans.sort()\nprint(*ans, sep=\"\\n\")\n", "passed": true, "time": 0.14, "memory": 14124.0, "status": "done"}, {"code": "n=int(input())\nA=[]\nfor i in range(n):\n    a=str(input())\n    A.append(a)\nimport collections\nc = collections.Counter(A)\nma= c.most_common()[0][1]\nC=[i[0] for i in c.items() if i[1] >=ma ]\nC.sort(reverse=False)\nfor j in range(len(C)):\n    print(C[j])", "passed": true, "time": 0.23, "memory": 14352.0, "status": "done"}, {"code": "from collections import defaultdict\ncharnums=defaultdict(int)\nN=int(input())\nfor _ in range(N):\n    charnums[input()]+=1\nans=[]\nm=max(charnums.values())\nfor key,value in charnums.items():\n    if value==m:\n        ans.append(key)\nfor an in sorted(ans):\n    print(an)", "passed": true, "time": 0.14, "memory": 14364.0, "status": "done"}, {"code": "import collections\nN=int(input())\nS=[]\nfor i in range(N):\n  s=input()\n  S.append(s)\n\nl=collections.Counter(S)\nkeys=l.keys()\nk=max(l.values())\nans=[]\nfor i in keys:\n  if l[i]==k:\n    ans.append(i)\n\nans.sort()\nn=len(ans)\n\nfor i in range(n):\n  print(ans[i])", "passed": true, "time": 0.15, "memory": 14068.0, "status": "done"}, {"code": "import collections\nN = int(input())\nS = []\nans = []\nfor i in range(N):\n  S.append(input())\nd = collections.Counter(S)\nome = max(d.values())\nfor k, v in list(d.items()):\n  if v == ome:\n    ans.append(k)\nans.sort()\nfor x in ans:\n  print(x)\n", "passed": true, "time": 0.14, "memory": 14124.0, "status": "done"}, {"code": "N = int(input())\n\nd = {}\nfor _ in range(N):\n    S = input()\n    if S in d:\n        d[S] += 1\n    else:\n        d[S] = 1\n\nm = max(d.values())\nfor s in sorted(k for k in d if d[k] == m):\n    print(s)", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "N = int(input())\nS = [input() for _ in range(N)]\n\ndic = {}\n\nfor i in range(N):\n  if S[i] not in list(dic.keys()):\n    dic[S[i]] = 1\n    \n  else:\n    dic[S[i]] += 1\n    \nmaxim = max(dic.values())\nans = []\n\nfor keys in list(dic.keys()):\n  if dic[keys] == maxim:\n    ans.append(keys)\n    \nans.sort()\n\nfor i in range(len(ans)):\n  print((ans[i]))\n", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "N = int(input())\nS = []\nfor i in range(N) :\n    S.append(input())\nS_set = set(S)\nS_sorted = sorted(S)\nS_sorted.append(\"null0\")\n\ncntlist = [[S_sorted[0],1]]\nj = 0\nfor i in range(len(S)-1) :\n    if cntlist[j][0] != S_sorted[i+1] :\n        cntlist.append([S_sorted[i+1],1])\n        j = j + 1\n    else :\n        cntlist[j][1] += 1\n\nmaxnum = 0\nfor i in range(len(cntlist)) :\n    maxnum = max(cntlist[i][1],maxnum)\ncntlist_new = []\nfor i in range(len(cntlist)) :\n    if cntlist[i][1] == maxnum :\n        cntlist_new.append(cntlist[i])\nfrom operator import itemgetter\nnew_cnt = sorted(cntlist_new,key = itemgetter(0),reverse = False)\n\n#print(S)\n#print(S_sorted)\n#print(cntlist_new)\n#print(new_cnt)\n\nfor i in range(len(new_cnt)) :\n    print(new_cnt[i][0])", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "import collections\n\nN = int(input())\n\nSlist = []\nfor i in range(N):\n  Slist.append(input())\n#print (Slist)\n\nanslist =sorted(Slist)\nc = collections.Counter(anslist)\nvalues, counts = zip(*c.most_common())\nmaxcount = counts[0]\ni = 0\n#print (values)\n#print (counts)\nfor i in range(len(values)):\n  if maxcount == counts[i]: \n    print (values[i])\n    maxcount = counts[i]\n    i+=1\n  else :\n    break", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "N = int(input())\ndic = {}\nfor _ in range(N):\n  S = input()\n  if S in dic:\n    dic[S] += 1\n  else:\n    dic[S] = 1\n\nlst = []\nM = max(dic.values())\nfor k in dic.keys():\n  if dic[k] == M:\n    lst.append(k)\n\nlst.sort()\n\nfor i in range(len(lst)):\n  print(lst[i])", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "n = int(input())\ns = list(input() for _ in range(n))\nd = {}\nfor i in range(n):\n    if s[i] in d:\n        d[s[i]] += 1\n    else:\n        d[s[i]] = 1\nm = max(d.values())\nfor s in sorted(k for k in d if d[k] == m):\n    print(s)", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "N = int(input())\ndic, rst = {}, []\nfor i in range(N):\n    s = input()\n    if s in dic:\n        dic[s] += 1\n    else:\n        dic[s] = 1\nmax_val = max(dic.values())\nrst = [ key for key, val in dic.items() if val == max_val ]\n[ print(i) for i in sorted(rst) ]", "passed": true, "time": 0.14, "memory": 14368.0, "status": "done"}, {"code": "n = int(input())\ndata = {}\nfor i in range(n):\n    s = str(input())\n    if s in data.keys():\n        data[s] += 1\n    else:\n        data[s] = 1\nm = max(list(data.values()))\nans = []\nfor j,k in data.items():\n    if k == m:\n        ans.append(j)\nfor l in sorted(ans):\n  print(l)", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "N = int(input())\n\nss = dict()\nfor i in range(N):\n    s = input()\n    ss[s] = ss.get(s, 0) + 1\nsss = [(-b, a) for a, b in list(ss.items())]\nsss.sort()\nmaxa = sss[0][0]\nfor a, b in sss:\n    if maxa != a:\n        break\n    print(b)\n", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "n = int(input())\nd = {}\nmax_value = 1\nfor i in range(n):\n\ts = input()\n\tif s in d:\n\t\td[s] += 1\n\t\tmax_value = max(max_value, d[s])\n\telse:\n\t\td[s] = 1\nl = []\nfor k in d:\n\tif d[k] == max_value:\n\t\tl.append(k)\nfor x in sorted(l):\n\tprint(x)", "passed": true, "time": 0.32, "memory": 14144.0, "status": "done"}, {"code": "\nn = int(input())\nl = [str(input()) for i in range(n)]\n\nl = sorted(l)\n\ncnt = 1\ncnt_max = 1\nmoji = []\n\nfor i in range(1, n):\n    if l[i] == l[i-1]:\n        cnt += 1\n        if i == n-1:\n            if cnt_max < cnt:\n                cnt_max = cnt\n                moji = [l[i-1]]\n            elif cnt_max == cnt:\n                moji.append(l[i-1])\n    else:\n        if cnt_max < cnt:\n            cnt_max = cnt\n            moji = [l[i-1]]\n        elif cnt_max == cnt:\n            moji.append(l[i-1])\n            if cnt_max == 1 and i == n-1:\n                moji.append(l[i])\n        cnt = 1\n\nfor i in range(len(moji)):\n    print((moji[i]))\n\n\n\n", "passed": true, "time": 0.14, "memory": 14328.0, "status": "done"}, {"code": "n = int(input())\nd = {}\n\nfor i in range(n):\n    s = input()\n    if s not in d:\n        d.update({s: 1})\n    else:\n        d[s] += 1\n\nmax_val = max(d.values())\nkeys_of_max_val = [key for key in d if d[key] == max_val]\nprint((\"\\n\".join(sorted(keys_of_max_val))))\n", "passed": true, "time": 0.14, "memory": 14324.0, "status": "done"}, {"code": "from collections import Counter\nimport heapq\n\nn = int(input())\nsc = Counter()\n\nfor x in range(n):\n  s = input()\n  sc.update([s])\n\nmax_num = sc.most_common()[0][1]\nq = []\nfor v in list(sc.items()):\n  if v[1] == max_num:\n    heapq.heappush(q, v[0])\n\nfor _ in range(len(q)):\n  print((heapq.heappop(q)))\n\n", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "N = int(input())\nd = {}\nfor i in range(N):\n    s = input()\n    if s in d:\n        d[s] += 1\n\n    else:\n        d[s] = 1\n\n\nl = sorted(d.items())\nM = max(d.values())\n\nfor i in l:\n    if d[i[0]] == M:\n        print(i[0])", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "from collections import Counter\nn=int(input())\ns=Counter([input()for _ in[0]*n])\nm=s.most_common(1)[0][1]\nr=sorted((k for k,v in s.items() if v==m))\nfor a in r:print(a)", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "from collections import Counter\nn = int(input())\ns = [input() for _ in range(n)]\ns = Counter(s)\ns = sorted(list(s.items()), reverse=True, key=lambda x: x[1])\nmax_count = max(list([x[1] for x in s]))\nans = sorted([l for l, c in s if c==max_count])\n\nfor a in ans:\n    print(a)\n", "passed": true, "time": 0.14, "memory": 14072.0, "status": "done"}, {"code": "N = int(input())\nS = sorted([input() for _ in range(N)])\nA = []\ncount = 1\nfor i in range(N-1):\n    if(i == N-2):\n        A.append(S[N-1])\n    if(S[i] != S[i+1]):\n        A.append(S[i])\nA.sort()\nB = [1]*len(A)\na = 0\nfor i in range(N-1):\n    if(S[i] == S[i+1]):\n        B[a] += 1\n    else:\n        a += 1\nm = max(B)\nfor i in range(len(A)):\n    if(B[i] == m):\n        print(A[i])", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "from collections import Counter\nn = int(input())\ns = list(input() for i in range(n))\nc = Counter(s)\nm = max(c.values())\ns = sorted(list(set(s)))\nfor i in range(len(s)):\n    if c[s[i]] == m:\n        print(s[i])", "passed": true, "time": 0.14, "memory": 14376.0, "status": "done"}, {"code": "N = int(input())\nS = dict()\nfor i in range(N):\n    s = input()\n    if s in S:\n        S[s] += 1\n    else:\n        S[s] = 1\n\nmax_val = max(S.values())\nmax_key = [key for key in S if S[key] == max_val]\nprint((\"\\n\".join(sorted(max_key))))\n", "passed": true, "time": 0.14, "memory": 14308.0, "status": "done"}, {"code": "N = int(input())\nS = [input() for _ in range(N)]\ndict_s = dict()\nfor s in S:\n    if s in dict_s:\n        dict_s[s] += 1\n    else:\n        dict_s[s] = 1\n\nsorted_s = sorted(dict_s.items(), key=lambda x: x[1], reverse=True)\nmax_s = []\nmax_count = -1\nfor s in sorted_s:\n    if s[1] >= max_count:\n        max_s.append(s[0])\n        max_count = s[1]\n\nfor s in sorted(max_s):\n    print(s)", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "'''n = int(input())\narr1 = []\narr2 = [0]*n\narr3 = []\nfor _ in range(n):\n    x = input()\n    if x not in arr1:\n        arr1.append(x)\n        arr2[arr1.index(x)] += 1\n    else:\n        arr2[arr1.index(x)] += 1\narr2 = set(arr2)\nmax_count = max(list(arr2.values()))\nans = []\nfor item in arr2.items():\n    (key, value) = item\n    if value == max_count:\n        arr3.append(key)\narr3.sort()\nfor j in arr3:\n    print(j)\n'''\nn = int(input())\ns = [input() for _ in range(n)]\ncount = {}\n\nfor word in s:\n    if word not in count:\n        count[word] = 1\n    else:\n        count[word] += 1\n\nmax_count = max(list(count.values()))\nans = []\nfor item in list(count.items()):\n    (key, value) = item\n    if value == max_count:\n        ans.append(key)\n\nans = sorted(ans)\nfor w in ans:\n    print(w)\n", "passed": true, "time": 0.15, "memory": 14268.0, "status": "done"}, {"code": "import collections\ndef i_input(): return int(input())\n\n\ndef i_map(): return list(map(int, input().split()))\n\n\ndef i_list(): return list(map(int, input().split()))\n\n\ndef i_row(N): return [int(input()) for _ in range(N)]\n\n\ndef i_row_list(N): return [list(map(int, input().split())) for _ in range(N)]\n\nn=i_input()\nss=[input() for _ in range(n)]\nss.sort()\nc = collections.Counter()\nfor word in ss:\n    c[word] += 1\n\nprtcnt=max(c.values())\nfor word,cnt in list(c.items()):\n    if cnt==prtcnt:\n        print(word)\n", "passed": true, "time": 0.65, "memory": 14364.0, "status": "done"}, {"code": "d=dict()\nfor _ in range(int(input())):s=input();d[s]=d.get(s,0)+1\nm=max(d.values());i=[k for k,v in d.items()if v==m]\nfor v in sorted(i):print(v)", "passed": true, "time": 0.57, "memory": 14200.0, "status": "done"}, {"code": "import os, sys, re, math\n\nN = int(input())\nS = []\nfor i in range(N):\n    S.append(input())\n\nd = {}\nfor s in S:\n    if not s in d:\n        d[s] = 0\n    d[s] += 1\n\nd = sorted(list(d.items()), key=lambda x:x[1], reverse=True)\nnames = [v[0] for v in d if v[1] == d[0][1]]\n\nfor name in sorted(names):\n    print(name)\n", "passed": true, "time": 0.16, "memory": 14280.0, "status": "done"}, {"code": "from collections import Counter\n\nn = int(input())\ns = []\nfor _ in range(n):\n    s.append(input())\n\ns.sort()\nc = Counter(s)\n\nvalues = sorted(list(c.values()), reverse=True)\nkeys = sorted(list(c.keys()))\nfor item in c:\n    if c[item] == values[0]:\n        print(item)\n", "passed": true, "time": 0.15, "memory": 14164.0, "status": "done"}, {"code": "def N():\n    return int(input())\ndef L():\n    return list(map(int,input().split()))\ndef NL(n):\n    return [list(map(int,input().split())) for i in range(n)]\nmod = pow(10,9)+7\n\n#import numpy as np\nimport sys\nimport math\nimport collections\n\nn = N()\ns = {}\nfor i in range(n):\n    a = input()\n    if a in s:\n        s[a] += 1\n    else:\n        s[a] = 1\n\ns = sorted(s.items(),key=lambda x:x[1],reverse=True)\nm = s[0][1]\ns2 = []\nfor i in range(len(s)):\n    if s[i][1] == m:\n        s2.append(s[i][0])\n    else:\n        break\n\ns2.sort()\nfor i in s2:\n    print(i)", "passed": true, "time": 0.16, "memory": 14252.0, "status": "done"}, {"code": "N = int(input())\nS = []\n\nfor i in range(N):\n\tS.append(str(input()))\nS.sort()\nS.append(0)\n\nprev_name = S[0]\ncnt = 1\nnames = []\ncnts = []\nfor i in range(1, N + 1):\n\tif prev_name == S[i]:\n\t\tcnt += 1\n\telse:\n\t\tnames.append(prev_name)\n\t\tcnts.append(cnt)\n\t\tprev_name = S[i]\n\t\tcnt = 1\nmax_cnt = max(cnts)\n\nfor i in range(len(names)):\n\tif cnts[i] == max_cnt:\n\t\tprint(names[i])", "passed": true, "time": 0.16, "memory": 14304.0, "status": "done"}, {"code": "\nn = int(input())\nd = {}\n\nfor i in range(n):\n    st = input()\n    if st in list(d.keys()):\n        d[st] += 1\n    else:\n        d[st] = 1\n\nm = max(list(d.values()))\nl = []\n\nfor x,y in list(d.items()):\n    if y == m:\n        l.append(x)\nl.sort()\n\nfor v in l:\n    print(v)\n\n", "passed": true, "time": 0.16, "memory": 14216.0, "status": "done"}, {"code": "#-*-coding:utf-8-*-\nimport sys\ninput=sys.stdin.readline\nimport collections\n\ndef main():\n    words=[]\n    word_dict=[]\n    n = int(input())\n    words=[input().rstrip() for _ in range(n)]\n    answers=[]\n\n    word_dict = collections.Counter(words)\n    max_count=max(word_dict.values())\n    [answers.append(values) for values,counts in word_dict.most_common() if counts==max_count]\n\n    for answer in sorted(answers):\n        print(answer)\n\ndef __starting_point():\n    main()\n__starting_point()", "passed": true, "time": 0.15, "memory": 14360.0, "status": "done"}, {"code": "N = int(input())\nS = []\nM = 1\ncount = 1\n\nfor _ in range(N):\n  S.append(input())\n\nS.sort()\nans=[S[0]]\n\nfor i in range(N-1):\n  if S[i] == S[i+1]:\n    count += 1\n  else:\n    if M < count:\n      M = count\n      ans = [S[i]]\n    elif M == count:\n      ans.append(S[i])\n    count = 1\nif M < count:\n  M = count\n  ans = [S[N-1]]\nelif M == count:\n  ans.append(S[N-1])\n\nans = list(set(ans))\nans.sort()\n\nfor j in range(len(ans)):\n  print(ans[j])", "passed": true, "time": 0.23, "memory": 14388.0, "status": "done"}, {"code": "import collections\nN = int(input())\nS = []\n\nfor i in range(N):\n    S.append(input())\n\nc = collections.Counter(S).most_common()\nans = []\n\nif len(c) == 1:\n    ans = c\nelse:\n    for k in range(N):\n        if c[0][1] == c[k][1]:\n            ans.append(c[k])\n        else:\n            break\nfor x in sorted(ans):\n    print(x[0])", "passed": true, "time": 0.14, "memory": 14360.0, "status": "done"}, {"code": "n = int(input())\ns = list(input() for _ in range(n))\nd = {}\nfor i in range(n):\n    if s[i] in d:\n        d[s[i]] += 1\n    else:\n        d[s[i]] = 1\n\nm = max(d.values())\nl=[]\nfor i in d:\n    if d[i] == m:\n        l.append(i)\nfor i in sorted(l):\n    print(i)", "passed": true, "time": 0.15, "memory": 14380.0, "status": "done"}, {"code": "N = int(input())\n\nd = {}\nfor _ in (range(N)):\n    s = input()\n    if s not in d.keys():\n        d[s] = 1\n    else:\n        d[s] += 1\n\nmax_n = max(d.values())\nans = []\nfor key,value in d.items():\n    if value == max_n:\n        ans.append(key)\n\nans.sort()\nfor i in ans:\n    print(i)", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "def main():\n\tn = int(input())\n\td = dict()\n\tfor _ in range(n):\n\t\ts = input()\n\t\tif s not in list(d.keys()):\n\t\t\td[s] =1\n\t\telse:\n\t\t\td[s] +=1\n\tmostFrequent = max(d.values())\n\tans = []\n\tfor key in list(d.keys()):\n\t\tif d[key] == mostFrequent:\n\t\t\tans.append(key)\n\tans.sort()\n\tfor i in ans:\n\t\tprint(i)\n\n\ndef __starting_point():\n    main()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "import math\nimport statistics\nimport collections\na=int(input())\n#b,c=int(input()),int(input())\n# c=[]\n#  for i in b:\n#     c.append(i)\n#e1,e2 = map(int,input().split())\n# f = list(map(int,input().split()))\ng = [input() for _ in range(a)]\n# h = []\n# for i in range(e1):\n#     h.append(list(map(int,input().split())))\n\ng.sort()\n\nma=0\ncount=1\n#\u6700\u5927\u5024\u6c42\u3081\u308b\nfor i in range(a-1):\n    if g[i]==g[i+1]:\n        count+=1\n    else:\n        ma=max(ma,count)\n        count=1\n\nma=max(ma,count)\ncount=1\nans=[]\n#\u6700\u5927\u5024\u306e\u4f4d\u7f6e\nfor i in range(a-1):\n    if g[i]==g[i+1]:\n        count+=1\n    else:\n        if count==ma:\n            ans.append(g[i])\n        count=1\nif count==ma:\n    ans.append(g[-1])\n\nfor i in ans:\n    print(i)\n", "passed": true, "time": 0.16, "memory": 14068.0, "status": "done"}, {"code": "N = int(input())\ndic = {}\nfor i in range(N):\n    s = input()\n    if s in dic:\n        dic[s] += 1\n    else:\n        dic[s] = 1\nmax_val = max(dic.values())\nrst = [ key for key, val in dic.items() if val == max_val ]\n[ print(i) for i in sorted(rst) ]", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "N=int(input())\nd=dict()\nfor _ in range(N):\n    S=input()\n    if S not in d:\n        d[S]=0\n    d[S]+=1\nM=max(d.values())\nans=[]\nfor S in list(d.keys()):\n    if d[S]==M:\n        ans.append(S)\nans.sort()\nfor S in ans:\n    print(S)\n", "passed": true, "time": 0.14, "memory": 14344.0, "status": "done"}, {"code": "import collections\n\nN = int(input())\nS = sorted([input() for _ in range(N)])\n\nc = collections.Counter(S)\n\nvmax = max(c.values())\n\nfor k, v in c.items():\n    if v == vmax:\n        print(k)", "passed": true, "time": 0.14, "memory": 14360.0, "status": "done"}, {"code": "n = int(input())\n\ndct = {}\n\nfor i in range(n):\n    s = input()\n    if s in dct:\n        dct[s] += 1\n    else:\n        dct[s] = 1\n\nmax_num = max(dct.values())\nans = []\nsorted_dct = sorted(dct.items())\n \nfor x in sorted_dct:\n    if x[1] >= max_num:\n        ans.append(x[0])\n \nprint(*ans, sep='\\n')", "passed": true, "time": 0.14, "memory": 14364.0, "status": "done"}, {"code": "N = int(input())\nS = [input() for _ in range(N)]\n\nd = {s: 0 for s in set(S)}\n\nfor i in range(N):\n    d[S[i]] += 1\n\ncount = 0\nfor key in d:\n    count = max(count, d[key])\n\nl = []\nfor key in d:\n    if count == d[key]:\n        l.append(key)\nl.sort()\n\nfor s in l:\n    print(s)\n", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "n = int(input())\ndd = {}\nfor i in range(n):\n\ts = input()\n\tif s in dd.keys():\n\t\tdd[s] += 1\n\telse:\n\t\tdd[s] = 1\nma = max(dd.values())\nlst = []\nfor k, v in dd.items():\n\tif v == ma:\n\t\tlst.append(k)\nfor l in sorted(lst):\n\tprint(l)", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "from collections import defaultdict\nn = int(input())\ndic = defaultdict(int)\nfor i in range(n):\n    dic[input()] += 1\ntmp = [(key, value) for key, value in dic.items()]\ntmp.sort(key=lambda x: (x[1], x[0]))\nm = tmp[-1][1]\nfor i in range(len(dic)):\n    if tmp[i][1] == m:\n        print (tmp[i][0])", "passed": true, "time": 0.14, "memory": 14252.0, "status": "done"}, {"code": "import collections\n\nn = int(input())\n\nli=[]\n\n\nfor i in range(n):\n    li.append(input())\n\ncnt = collections.Counter(li)\nS = cnt.most_common()\n\n\nC =len(cnt)\n\nli_1 = [S[0][0]]\n\nfor i in range(C-1):\n    if S[i][1] == S[i+1][1]:\n        li_1.append(S[i+1][0])\n    else:\n        break\n\nli_1.sort()\n\nfor i in li_1:\n    print(i)\n", "passed": true, "time": 0.15, "memory": 14312.0, "status": "done"}, {"code": "import collections as c\na=c.Counter(input() for _ in range(int(input())));b=a.most_common(1)[0][1]\nprint(*sorted([i for i,j in a.items() if j==b]),sep='\\n')", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "n = int(input())\nd = {}\nt = 0\nfor i in range(n):\n    s = input()\n    d[s] = d.get(s, 0) + 1\n    t = max(t, d[s])\n    \nfor key in sorted(d):\n    if d[key] == t:\n        print(key)", "passed": true, "time": 0.15, "memory": 14312.0, "status": "done"}, {"code": "n = int(input())\nd = {}\nm = 0\nfor i in range(n):\n    s = input()\n    d[s] = d.get(s, 0) + 1\n    if m <= d[s]:\n        m = d[s]\nc = []\nfor i in d:\n    if d[i]==m:\n        c.append(i)\nc.sort()\nfor x in c:\n    print(x)", "passed": true, "time": 0.14, "memory": 14364.0, "status": "done"}, {"code": "n = int(input())\ns = [input() for _ in range(n)]\ncount = {}\n\nfor word in s:\n    if word not in count:\n        count[word] = 1\n    else:\n        count[word] += 1\n\nmax_count = max(list(count.values()))\nans = []\nfor item in count.items():\n    (key, value) = item\n    if value == max_count:\n        ans.append(key)\n\nans = sorted(ans)\nfor w in ans:\n    print(w)", "passed": true, "time": 0.15, "memory": 14380.0, "status": "done"}, {"code": "n = int(input())\nL = list(input() for _ in range(n))\nD = dict.fromkeys(set(L),0)\n\nfor l in L:\n  D[l] += 1\n\nm = max(D.values())\nSD = sorted(D.items(), key=lambda x:x[0])\n\nfor k, v in SD:\n  if v == m:\n    print(k)", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "N = int(input())\ndic, rst = {}, []\nfor i in range(N):\n    s = input()\n    if not s in dic:\n        dic[s] = 1\n    else:\n        dic[s] += 1\nmax_val = max(dic.values())\nrst = [ key for key, val in dic.items() if val == max_val ]\n[ print(i) for i in sorted(rst) ]", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "q=int(input())\ndic={}\nfor i in range(q):\n    s=input()\n    if not s in dic:\n        dic[s]=1\n    else:\n        dic[s]+=1\nmax_val=max(dic.values())\na=sorted([i for i, k in list(dic.items()) if k == max_val])\nfor i in a:\n    print(i)\n", "passed": true, "time": 0.14, "memory": 14140.0, "status": "done"}, {"code": "n = int(input())\ns = [input() for _ in range(n)]\nans = []\nd = {}\nfor i in s:\n    try: d[i] += 1\n    except KeyError: d[i] = 1\nmx = 0\nfor value in list(d.values()):\n    if value > mx: mx = value\nfor key, value in list(d.items()):\n    if value == mx:\n        ans.append(key)\nfor v in sorted(ans):\n    print(v)\n", "passed": true, "time": 0.14, "memory": 14252.0, "status": "done"}, {"code": "from collections import Counter\n\nn = int(input())\ns = [input() for _ in range(n)]\n\nc = Counter(s)\nm = c.most_common()[0][1]\nk = list(c.keys())\nv = list(c.values())\n\nl = []\nfor i in range(len(c)):\n  if v[i] == m:\n    l.append(k[i])\n\nl.sort()\n    \nprint(*l,sep=\"\\n\")", "passed": true, "time": 0.15, "memory": 14220.0, "status": "done"}, {"code": "# C\nfrom collections import Counter\nN = int(input())\nS = [input() for _ in range(N)]\ncountS = Counter(S)\nmaxS = max(countS.values())\nans = []\nfor key,value in list(countS.items()):\n  if value == maxS:\n    ans.append(key)\n\nfor a in sorted(ans):\n  print(a)\n", "passed": true, "time": 0.14, "memory": 14148.0, "status": "done"}, {"code": "n = int(input())\nS = dict()\nfor i in range(n):\n    s = input()\n    if s in S:  S[s] += 1\n    else:  S[s] = 1\nans = []\ncnt = 0\nfor k,v in S.items():\n    if v >= cnt:\n        if v > cnt:  ans = []\n        ans.append(k)\n        cnt = v\nprint(*sorted(ans), sep='\\n')\n", "passed": true, "time": 0.14, "memory": 14148.0, "status": "done"}, {"code": "N = int(input())\nA = {}\nfor i in range(N):\n  s = input()\n  if s in A:\n    A[s] += 1\n  else:\n    A[s] = 1\ns_max = max(A.values())\nfor j in sorted(k for k in A if A[k] == s_max):\n  print(j)", "passed": true, "time": 0.14, "memory": 14320.0, "status": "done"}, {"code": "def sovle():\n    N = int(input())\n\n    d = {}\n    max = []\n    max_count = 0\n    for i in range(N):\n        s = input()\n        if s in d:\n            d[s] += 1\n        else:\n            d[s] = 1\n    \n        if max_count < d[s]:\n            max = [s]\n            max_count=d[s]\n        elif max_count == d[s]:\n            max.append(s)\n    \n    max.sort()\n\n    for i in max:\n        print(i)\n    \nsovle()", "passed": true, "time": 0.15, "memory": 14100.0, "status": "done"}, {"code": "N = int(input())\nS = [input() for _ in range(N)]\n\n# cnts = {key: S.count(key) for key in S}\ncnts = {key: 0 for key in S}\nfor key in S:\n  cnts[key] += 1\n\nmax_cnt = max(cnts.values())\n\nans = [k for k, v in cnts.items() if v == max_cnt]\nans.sort()\n\nprint(*ans, sep='\\n')", "passed": true, "time": 0.14, "memory": 14256.0, "status": "done"}, {"code": "import collections\nn = int(input())\nl = []\nfor i in range(n):\n  l.append(input())\nc = collections.Counter(l)\nm = max(c.values())\nchars = [key for key, value in c.items() if value == m]\nchars.sort()\nfor s in chars:\n  print(s)", "passed": true, "time": 0.17, "memory": 14188.0, "status": "done"}, {"code": "from collections import Counter\n\nn = int(input())\nS = [input() for _ in range(n)]\nC = Counter(S)\nC_most = C.most_common()\n\nans = []\nfor key, val in C_most:\n    if val == C_most[0][1]:\n        ans.append(key)\n    else:\n        break\n        \nprint(*sorted(ans), sep='\\n')", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "import sys\nimport math\nfrom collections import defaultdict, deque, Counter\nfrom copy import deepcopy\nfrom bisect import bisect, bisect_right, bisect_left\nfrom heapq import heapify, heappop, heappush\n    \ninput = sys.stdin.readline\ndef RD(): return input().rstrip()\ndef F(): return float(input().rstrip())\ndef I(): return int(input().rstrip())\ndef MI(): return map(int, input().split())\ndef MF(): return map(float,input().split())\ndef LI(): return list(map(int, input().split()))\ndef TI(): return tuple(map(int, input().split()))\ndef LF(): return list(map(float,input().split()))\ndef Init(H, W, num): return [[num for i in range(W)] for j in range(H)]\n    \n    \ndef main():\n    N = I()\n    D = defaultdict(int)\n    for i in range(N):\n        D[input().rstrip()]+=1\n    D = D.items()\n    D = sorted(D, key = lambda x:x[0])\n    D = sorted(D, key = lambda x:x[1], reverse = True)\n    num = D[0][1]\n    \n    for key, n in D:\n        if n != num:\n            return\n        print(key)\n    \ndef __starting_point():\n    main()\n__starting_point()", "passed": true, "time": 0.16, "memory": 14384.0, "status": "done"}, {"code": "N = int(input())\ndic = {}\nfor i in range(N):\n    s = input()\n    if s in dic:\n        dic[s] += 1\n    else:\n        dic[s] = 1\nmax_val = max(dic.values())\nrst = [ key for key, val in dic.items() if val == max_val ]\n[ print(i) for i in sorted(rst) ]", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "N = int(input())\ndic = {}\nmax_count = 1\n\nfor i in range(N):\n    s = input()\n    if s not in dic:\n        dic[s] = 1\n    else:\n        dic[s] += 1\n        if max_count < dic[s]:\n            max_count = dic[s]\n\nans_lis = []\n\nfor i, j in dic.items():\n    if j == max_count:\n        ans_lis.append(i)\n\nans_lis.sort()\n\nfor i in ans_lis:\n    print(i)", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}, {"code": "N = int(input())\n\ndct = {}\n\nfor i in range(N):\n    s = input()\n    if not s in dct:\n        dct[s] = 1\n\n    else:\n        dct[s] +=  1\n    \nm = max(dct.values())\nfor s in sorted(k for k in dct if dct[k] == m):\n    print(s)", "passed": true, "time": 0.14, "memory": 14160.0, "status": "done"}, {"code": "import collections\nN=int(input())\ns=[str(input()) for i in range(N)]\nc=collections.Counter(s)\nmaximum =max(c.values()) \nmax_c_list = sorted(key for key,value in c.items() if value == maximum)\nfor s in max_c_list:\n  print(s)", "passed": true, "time": 0.14, "memory": 14364.0, "status": "done"}, {"code": "n = int(input())\na = {}\nfor i in range(n):\n    s = input()\n    if s not in a:\n        a.update({s: 0})\n    else:\n        temp = a[s] + 1\n        a.update({s:temp})\nmax_val = max(list(a.values()))\nb = []\nfor key in a:\n    if a[key] == max_val:\n        b.append(key)\nb.sort()\nprint(*b, sep='\\n')", "passed": true, "time": 0.14, "memory": 14316.0, "status": "done"}, {"code": "n = int(input())\ncount_dict = {}\nfor i in range(n):\n    i = input()\n    if i in count_dict.keys():\n        count_dict[i] +=1\n    else:\n        count_dict[i] = 0\nmax_value = max(count_dict.values())\nfor key,value in sorted(count_dict.items()):\n    if value == max_value:\n        print(key)", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "# coding: utf-8\nfrom collections import defaultdict\n\n\ndef main():\n    N = int(input())\n    dic = defaultdict(int)\n    max_p = 0\n\n    for i in range(N):\n        dic[input()] += 1\n\n    d = dict(dic)\n    l = []\n\n    for key, value in list(d.items()):\n        l.append([key, value])\n        if max_p < value: max_p = value\n    \n    l.sort(key=lambda x: (-x[1], x[0]), reverse=False)\n\n    for i, j in l:\n        if j == max_p:\n            print(i)\n        else:\n            break\n\n\ndef __starting_point():\n    main()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "import collections\nN=int(input())\nL=[]\nfor i in range(N):\n  L.append(input())\nC=collections.Counter(L)\nMax=C.most_common()[0][1]\nl = [i[0] for i in C.items() if i[1] == Max]\nprint(*sorted(l),sep='\\n')\n\n", "passed": true, "time": 0.23, "memory": 14244.0, "status": "done"}, {"code": "import collections\n\nn = int(input())\ns = [input() for _ in range(n)]\n\nc = collections.Counter(s)\nsorted_c = c.most_common()\nmax = sorted_c[0][1]\ndict_c = []\nfor i in range(len(sorted_c)):\n    if sorted_c[i][1] == max:\n        dict_c.append(sorted_c[i][0])\n    else:\n        break\n\ndict_c.sort()\nfor i in range(len(dict_c)):\n    print((dict_c[i]))\n", "passed": true, "time": 0.23, "memory": 14192.0, "status": "done"}, {"code": "N = int(input())\ndic,rst = {}, []\nfor i in range(N):\n    s = input()\n    if s in dic:\n        dic[s] += 1\n    else:\n        dic[s] = 1\nmax_val = max(dic.values())\nrst = [ key for key, val in dic.items() if val == max_val ]\n[ print(i) for i in sorted(rst) ]", "passed": true, "time": 0.14, "memory": 14388.0, "status": "done"}, {"code": "N = int(input())\ndic, lis = {}, []\nfor i in range(N):\n    s = input()\n    if s in dic:\n        dic[s] += 1\n    else:\n        dic[s] = 1\n\nM = max(dic.values())\n\nfor s in dic.keys():\n    if dic[s] == M:\n        lis.append(s)\nans = sorted(lis)\nfor s in ans:\n    print(s)", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "N = int(input())\ndic, rst = {}, []\nfor i in range(N):\n    s = input()\n    if s in dic:\n        dic[s] += 1\n    else:\n        dic[s] = 1\nmax_val = max(dic.values())\nrst = [ key for key, val in dic.items() if val == max_val ]\n[ print(i) for i in sorted(rst) ]", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "N = int(input())\ndic = {}\nfor i in range(N):\n    s = input()\n    if s in dic:\n        dic[s] += 1\n    else:\n        dic[s] = 1\nmax_val = max(dic.values())\nrst = [ key for key, val in dic.items() if val == max_val ]\n[ print(i) for i in sorted(rst) ]", "passed": true, "time": 0.14, "memory": 14292.0, "status": "done"}, {"code": "import collections\ndef resolve():\n    n = int(input())\n    s = [input() for _ in range(n)]\n    c = collections.Counter(s)\n    max_count = c.most_common()[0][1]\n    ans = [i[0] for i in c.items() if i[1]==max_count]\n    for i in sorted(ans): print(i)\nresolve()", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "from collections import Counter\n\nN = int(input())\nS = [input() for _ in range(N)]\n\ncnts = Counter(S)\nmax_l = max(cnts.values())\n\nans = [s for s, c in cnts.items() if c == max_l]\nans.sort()\n\nprint(*ans, sep='\\n')", "passed": true, "time": 0.15, "memory": 14256.0, "status": "done"}, {"code": "n = int(input())\n\ncnt = {}\nfor i in range(n):\n    s = input()\n    if s in cnt:\n        cnt[s] += 1\n    else:\n        cnt[s] = 1\n\nres = []\n\nmaks = max(list(cnt.items()), key=lambda x : x[1])\nfor item in list(cnt.items()):\n    if item[1] == maks[1]:\n        res.append(item[0])\n\nres.sort()\nfor s in res:\n    print(s)\n\n", "passed": true, "time": 0.14, "memory": 14324.0, "status": "done"}, {"code": "N = int(input())\nS = [input() for _ in range(N)]\ndic = {}\nfor i in range(N):\n    if S[i] not in list(dic.keys()):\n        dic[S[i]] = 1\n    else:\n        dic[S[i]] += 1\n\nmaxI = max(dic.values())\nans = []\n\nfor keys in list(dic.keys()):\n    if dic[keys] == maxI:\n        ans.append(keys)\n\nans.sort()\n\nfor i in ans:\n    print(i)\n", "passed": true, "time": 0.14, "memory": 14240.0, "status": "done"}, {"code": "n=int(input())\n\nl={}\na=0\n\nfor i in range(n):\n    s=input()\n    if s in l:\n        l[s]+=1\n    else:\n        l[s]=1\n    if a<l[s]:\n        a=l[s]\nans=[]\n\nfor i in list(l.keys()):\n    if l[i]==a:\n        ans.append(i)\n\nans.sort()\n\nfor j in ans:\n    print(j)\n", "passed": true, "time": 0.15, "memory": 14248.0, "status": "done"}, {"code": "N = int(input())\ndic = {}\nfor i in range(N):\n    s = str(input())\n    if s in dic:\n        dic[s] += 1\n    else:\n        dic[s] = 1\n\nS = sorted(dic.values())\nt = S[-1]\n\nX = []\nfor key in dic:\n    if dic[key] == t:\n        X.append(key)\nx = sorted(X)\n\nfor i in range(len(X)):\n    print(x[i])", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "N = int(input())\ndic, rst = {}, []\nfor i in range(N):\n    key = input()\n    if key in dic:\n        dic[key] += 1\n    else:\n        dic[key] = 1\nmax_val = max(dic.values())\nrst = [ key for key, value in dic.items() if value == max_val ]\n[ print(i) for i in sorted(rst) ]", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "n = int(input())\ns = [input() for i in range(n)]\ndic = {}\nfor i in range(n):\n    if s[i] in dic.keys():\n        dic[s[i]] += 1\n    else:\n        dic[s[i]] = 1\nmax1 = max(dic.values())\nans = []\nfor keys in dic.keys():\n    if dic[keys] == max1:\n        ans.append(keys)\nans.sort()\nfor i in ans:\n    print(i)", "passed": true, "time": 0.14, "memory": 14140.0, "status": "done"}, {"code": "import collections\nn = int(input())\nans = list(input() for i in range(n))\nans = collections.Counter(ans)\nm = max(ans.values())\nkeys = [k for k, v in ans.items() if v == m]\n[print(j) for j in sorted(keys)]", "passed": true, "time": 0.14, "memory": 14352.0, "status": "done"}, {"code": "import collections\nn = int(input())\nnames = [input() for _ in range(n)]\nc = collections.Counter(names)\nmaxv = max(c.values())\nans = []\nfor i in c.items():\n    if i[1] == maxv:\n        ans.append(i[0])\nans = sorted(ans)\nfor i in ans:\n    print(i)", "passed": true, "time": 0.14, "memory": 14044.0, "status": "done"}, {"code": "n = int(input())\n\ndic = {}\n\nfor x in range(n):\n    a = input()\n    dic.setdefault(a,0)\n    dic[a] += 1\n\ndic2 = sorted(list(dic.items()),key=lambda x:x[1],reverse=True)\n\nmax_word = [k for k,v in dic2 if v == dic2[0][1] ]\n\nmax_word.sort()\n\nfor x in max_word:\n    print(x)\n", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "N = int(input())\nS = [input() for _ in range(N)]\nS.sort()\n\nres = 0\ncnt = 1\nfor i in range(N-1):\n    if S[i] == S[i+1]:\n        cnt+=1\n    else:\n        res = max(res,cnt)\n        cnt = 1\n\nres = max(res,cnt)\n\ncnt = 1\nans = []\nfor i in range(N-1):\n    if S[i] == S[i+1]:\n        cnt+=1\n    else:\n        if res == cnt:\n            ans.append(S[i])\n        cnt = 1\n\nif cnt == res:\n    ans.append(S[i+1])\n\nfor i in range(len(ans)):\n    print((ans[i]))\n", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}]