problem_id
stringlengths
6
6
user_id
stringlengths
10
10
time_limit
float64
1k
8k
memory_limit
float64
262k
1.05M
problem_description
stringlengths
48
1.55k
codes
stringlengths
35
98.9k
status
stringlengths
28
1.7k
submission_ids
stringlengths
28
1.41k
memories
stringlengths
13
808
cpu_times
stringlengths
11
610
code_sizes
stringlengths
7
505
p02773
u453623947
2,000
1,048,576
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.
['N = int(input())\nd = {}\nfor _ in range(N):\n S = input()\n if S in l :\n d[S] += 1\n else :\n d[S] = 1\n\nm = max(d.values())\n\nfor s in sorted(k for k in d if d[k]==m) :\n print(s)\n', 'N = int(input())\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())\n\nfor s in sorted(k for k in d if d[k]==m) :\n print(s)\n']
['Runtime Error', 'Accepted']
['s566086432', 's382118159']
[9184.0, 35360.0]
[26.0, 478.0]
[199, 199]
p02773
u453642820
2,000
1,048,576
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.
['from collections import Counter\nN=int(input())\nS=[input() for i in range(N)]\ns=Counter(S)\nm=max(s.values())\nfor key,value in s.items():\n if value==m:\n print(key)', 'from collections import Counter\nN=int(input())\nS=[input() for i in range(N)]\ns=Counter(S)\nm=max(s.values())\ns=sorted(s.items() ,key=lambda s:s[0])\nfor a in s:\n if a[1]==m:\n print(a[0])']
['Wrong Answer', 'Accepted']
['s689428920', 's347686867']
[35572.0, 46576.0]
[444.0, 738.0]
[171, 194]
p02773
u453815934
2,000
1,048,576
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.
['x=int(input())\nList=[int(input()) for i in range (x)]\nsorted(List)\nprint(List)', 'x=int(input())\nList=[input() for i in range (x)]\nList=sorted(List)\nsum=-1\ncount=1\nans=[]\nfor i in range (x-1):\n if List[i] == List[i+1]:\n count+=1\n elif sum>count:\n count=1\n elif sum==count:\n count=1\n ans+=[List[i]]\n else:\n sum=count\n count=1\n ans=[]\n ans+=[List[i]]\nif sum==count:\n ans+=[List[-1]]\nelif sum<count:\n sum=count\n count=1\n ans=[]\n ans+=[List[i]]\nans=sorted(ans)\nfor i in ans:\n print(i)']
['Runtime Error', 'Accepted']
['s372326338', 's833018434']
[3060.0, 21548.0]
[18.0, 641.0]
[78, 500]
p02773
u455957070
2,000
1,048,576
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.
['n = int(input())\nint i = 0\nList = [input() for i in range(n)]\nprint(sorted(List))', 'n = int(input())\nList = [input() for i in range(n)]\nprint(sorted(List))\n', 'n = int(input())\ns = [input() for _ in range(n)]\n\ndic={}\nfor i in range(n):\n if s[i] not in dic:\n dic[s[i]]=1\n else:\n dic[s[i]]+=1\n\nlargest=max(dic.values())\nans=list()\n\nfor key in dic.keys():\n if dic[key]==largest:\n ans.append(key)\n\nans.sort()\nfor answers in ans:\n print(answers)\n']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s583335869', 's755440768', 's287821988']
[2940.0, 26564.0, 35216.0]
[17.0, 431.0, 649.0]
[81, 72, 314]
p02773
u460386402
2,000
1,048,576
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.
['n=int(input())\ns=[]\na=[]\ncount=1\nans=1\nfor i in range(n):\n c=input()\n s.append(c)\ns=sorted(s)\nprint(s)\nfor i in range(n-1):\n if s[i]==s[i+1]:\n count+=1\n else:\n if ans<count:\n a.clear()\n a.append(s[i])\n ans=count\n elif ans==count:\n a.append(s[i])\n count=1\n \nprint(a)', 'n=int(input())\ns={}\nl=[]\nfor i in range(n):\n a=input()\n if a in s:\n s[a]+=1\n else:\n s[a]=1\n \ncou=max(s.values())\n\nfor k,v in s.items():\n if v==cou:\n l.append(k)\n \nans=sorted(l)\n\nfor i in ans:\n print(i)']
['Wrong Answer', 'Accepted']
['s242142699', 's851971297']
[29772.0, 35624.0]
[583.0, 480.0]
[302, 221]
p02773
u460748766
2,000
1,048,576
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.
['N = int(input())\nans = dict()\nfor _ in range(N):\n k = str(input())\n if k in ans:\n ans[k]+=1\n else:\n ans.update({k:1})\ngroupedByValue = defaultdict(list)\nfor key, value in sorted(ans.items()):\n groupedByValue[value].append(key)\nl = groupedByValue[max(groupedByValue)]\nfor i in l:\n print(i)', 'from collections import defaultdict\nfrom collections import OrderedDict\nN = int(input())\nans = dict()\nfor _ in range(N):\n k = str(input())\n if k in ans:\n ans[k]+=1\n else:\n ans.update({k:1})\ngroupedByValue = defaultdict(list)\nfor key, value in sorted(ans.items()):\n groupedByValue[value].append(key)\nl = groupedByValue[max(groupedByValue)]\nfor i in l:\n print(i)']
['Runtime Error', 'Accepted']
['s123486274', 's562254166']
[32096.0, 45844.0]
[472.0, 930.0]
[317, 389]
p02773
u461592867
2,000
1,048,576
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.
['# -*- coding: utf-8 -*-\n\nN = int(input())\nS = [input().strip() for _ in range(N)]\n\nd = {}\nfor s in S:\n d.setdefault(s, 0)\n d[s] += 1\n\ndmax = max(d.values())\n\nfor key, value in d.items():\n if value == dmax:\n print(key)\n', '# -*- coding: utf-8 -*-\n\nN = int(input())\nS = [input().strip() for _ in range(N)]\n\nd = {}\nfor s in S:\n d.setdefault(s, 0)\n d[s] += 1\n\ndmax = max(d.values())\n\ndmax_list = [k for k, v in d.items() if v == dmax]\nfor d in sorted(dmax_list):\n print(d)']
['Wrong Answer', 'Accepted']
['s883361771', 's089522016']
[35216.0, 35216.0]
[566.0, 684.0]
[234, 255]
p02773
u461836414
2,000
1,048,576
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.
['n = int(input())\nd = {}\nfor i range(n):\n s = input()\n if s not in d:d[s] = 0\n d[s] += 1\nmax_cnt = sorted(d.items(), key=lambda tp:tp[1])[-1][1]\na1 = filter(lambda tp:tp[1] == max_cnt, d.items())\na2 = map(lambda tp:tp[0], a1)\nfor s in sorted(a2):\n print(s)', 'n = int(input())\nd = {}\nfor i in range(n):\n s = input()\n if s not in d:d[s] = 1\n d[s] += 1\nmax_cnt = sorted(d.items(), key=lambda x:x[1])[-1][1]\ns = [x for x, y in d.items() if y == max_cnt]\ns.sort()\nfor name in s:\n print(name)']
['Runtime Error', 'Accepted']
['s208835684', 's477184024']
[2940.0, 43228.0]
[17.0, 730.0]
[259, 233]
p02773
u464244643
2,000
1,048,576
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.
['import sys\nsys.setrecursionlimit(10 ** 6)\nMOD = 10**9+7\n \n\ndef input():\n return sys.stdin.readline()[:-1]\n \n\ndef main():\n n = int(input())\n d = dict()\n for _ in range(n):\n s = input()\n d.setdefault(s, 0)\n d[s] += 1\n d = sorted(d.items(), key=lambda x: -x[1])\n maxc = d[0][1]\n for row in d:\n if row[1]<maxc:\n break\n print(row[0])\n \nif __name__ == "__main__":\n main()', 'import sys\nsys.setrecursionlimit(10 ** 6)\nMOD = 10**9+7\n \n\ndef main():\n n = int(input())\n d = dict()\n for _ in range(n):\n s = input()\n d.setdefault(s, 0)\n d[s] += 1\n d = sorted(d.items(), key=lambda x: (-x[1], x[0]))\n maxc = d[0][1]\n for row in d:\n if row[1]<maxc:\n exit()\n print(row[0])\n \nif __name__ == "__main__":\n main()']
['Wrong Answer', 'Accepted']
['s311793849', 's652566794']
[43228.0, 57436.0]
[405.0, 946.0]
[435, 391]
p02773
u465067725
2,000
1,048,576
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.
['n = int(input())\nvote = dict()\nfor i in range(n):\n s = input()\n if s not in vote.keys():\n vote[s] = 0\n else:\n vote[s] += 1\nvote.sort()\nres = sorted(vote.values(), reverse = True)\nfor i in res.keys():\n print(i)', 'n = int(input())\nvote = dict()\nfor i in range(n):\n s = input()\n if s not in vote.keys():\n vote[s] = 0\n else:\n vote[s] += 1\n\nres = []\nmx = max(vote.values())\nfor key, value in vote.items():\n if value== mx:\n res.append(key)\n\nres = sorted(res)\nfor i in res:\n print(i)']
['Runtime Error', 'Accepted']
['s307415372', 's593874348']
[32096.0, 33116.0]
[416.0, 700.0]
[219, 284]
p02773
u466335531
2,000
1,048,576
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.
['from collections import defaultdict\nn=int(input())\ndic=defaultdict(int)\nfor _ in range(n):\n s = input()\n dic[s]+=1\nL=list(dic.items())\nL.sort(key=lambda x:x[0])\nc=L[0][1]\nfor a,b in L:\n c=max(c,b)\nfor p in L:\n if p[1] == c:\n print(p[0])\n else:\n break\n', 'from collections import defaultdict\nn=int(input())\ndic=defaultdict(int)\nfor _ in range(n):\n s = input()\n dic[s]+=1\nL=list(dic.items())\nL.sort(key=lambda x:-x[1])\nc = L[0][1]\nfor p in L:\n if p[1] == c:\n print(p[0])\n else:\n break\n ', 'from collections import defaultdict\nn=int(input())\ndic=defaultdict(int)\nfor _ in range(n):\n s = input()\n dic[s]+=1\nL=list(dic.items())\nL.sort(key=lambda x:x[0])\nc=L[0][1]\nfor a,b in L:\n c=max(c,b)\nfor a,b in L:\n if b == c:\n print(a)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s680847386', 's966070140', 's749842306']
[47252.0, 45304.0, 46880.0]
[926.0, 706.0, 917.0]
[280, 258, 251]
p02773
u469953228
2,000
1,048,576
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.
['n=int(input())\n\nA=[]\nB=[]\nfor i in range(n):\n s=input()\n if s not in A:\n A.append(s)\n B.append(1)\n else:\n B[A.index(s)] += 1\n\nC=[]\nfor i in range(len(B)):\n C.append([B[i],A[i]])\n\nC = sorted(C,reverse=True)\n\nfor i in range(len(C)-1):\n print(str(C[i][1]))\n if C[i][0] != C[i+1][0]:\n exit()\n\n', "n=int(input())\nl=[]\nL=[]\nfor _ in range(n):\n s=input()\n l.append(s)\nimport collections\nc = collections.Counter(l)\n\nfor i in range(n):\n L.append(c.most_common()[i][0])\n if i!=n-1:\n if c.most_common()[i][1] != c.most_common()[i+1][1]:\n break\nL.sort()\nL=' '.join(L)\nprint(L)", 'import collections\nn = int(input())\ns = []\nfor _ in range(n):\n s.append(input())\n\nc = collections.Counter(s)\nm = c.most_common()[0]\n\nans = []\nfor _c in c.items():\n if _c[1] == m[1]:\n ans.append(_c[0])\n\nfor v in sorted(ans):\n print(v)\n']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s253227881', 's849113040', 's412199852']
[4724.0, 45068.0, 45036.0]
[2107.0, 2106.0, 700.0]
[307, 283, 250]
p02773
u472197237
2,000
1,048,576
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.
["def main():\n N = int(input())\n str_dict = dict()\n for n in range(N):\n s = input()\n if s in str_dict:\n str_dict[s] += 1\n else:\n str_dict[s] = 1\n max_s = max(str_dict.values())\n for a, b in str_dict.items():\n if b == max_s:\n print(a)\n\n\nif __name__ == '__main__':\n main()", "def main():\n N = int(input())\n str_dict = dict()\n for n in range(N):\n s = input()\n if s in str_dict:\n str_dict[s] += 1\n else:\n str_dict[s] = 1\n max_s = max(str_dict.values())\n result_list = list()\n for a, b in str_dict.items():\n if b == max_s:\n result_list.append(a)\n result_list.sort()\n for r in result_list:\n print(r)\n\n\nif __name__ == '__main__':\n main()\n"]
['Wrong Answer', 'Accepted']
['s817539564', 's058740226']
[32096.0, 32096.0]
[462.0, 602.0]
[347, 452]
p02773
u472696272
2,000
1,048,576
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.
['n = int(input())\ndic = {}\nfor i in range(n):\n s = input()\n if s not in dic: dic[s] = 1\n else: dic[s] += 1\nv = dic.values()\nv = sorted(v)\nmax_num = v[n-1]\nans = []\nfor s in dic:\n if dic[s]==max_num:\n ans.append(s)\nans = sorted(ans)\nfor i in range(len(ans)):\n print(ans[i])\n', 'n = int(input())\ndic = {}\nfor i in range(n):\n s = input()\n if s not in dic: dic[s] = 1\n else: dic[s] += 1\nv = dic.values()\nv = sorted(v)\nmax_num = v[len(v)-1]\nans = []\nfor s in dic:\n if dic[s]==max_num:\n ans.append(s)\nans = sorted(ans)\nfor i in range(len(ans)):\n print(ans[i])']
['Runtime Error', 'Accepted']
['s412688620', 's081799063']
[34652.0, 34652.0]
[758.0, 714.0]
[280, 284]
p02773
u474925961
2,000
1,048,576
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.
['from collections import Counter\nn=int(input())\n\nlst=[input() for _ in range(n)]\np=Counter(lst)\npp=list(Counter(p).values()).count(max(p.values()))\nfor i in range(pp):\n print(p.most_common()[i][0])\n ', 'n=int(input())\n\ndic={}\nfor i in range(n):\n s=input()\n if s not in dic:\n dic[s]=1\n else:\n dic[s]+=1\ndic2=sorted(dic.items(), key=lambda x:x[1],reverse=True)\nma=dic2[0][1]\n\nkeys=sorted([k for k,v in dic.items() if v==ma])\nfor i in keys:\n print(i)']
['Wrong Answer', 'Accepted']
['s455323694', 's799136699']
[45028.0, 47320.0]
[2105.0, 723.0]
[232, 270]
p02773
u475503988
2,000
1,048,576
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.
['from collections import defaultdict\nN = int(input())\nS = [input() for _ in range(N)]\nd = defaultdict(int)\nmaxn = 0\n\nfor i in range(N):\n d[S[i]] += 1\n maxn = max(maxn, d[S[i]])\n\nfor k, v in d.items():\n if v == maxn:\n print(k)\n', 'from collections import defaultdict\nN = int(input())\nS = [input() for _ in range(N)]\nd = defaultdict(int)\nmaxn = 0\n\nfor i in range(N):\n d[S[i]] += 1\n maxn = max(maxn, d[S[i]])\n\nans = []\nfor k, v in d.items():\n if v == maxn:\n ans.append(k)\nans.sort()\nfor s in ans:\n print(s)\n']
['Wrong Answer', 'Accepted']
['s480986861', 's107675589']
[35572.0, 35572.0]
[559.0, 760.0]
[241, 293]
p02773
u477650749
2,000
1,048,576
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.
['n = int(input())\ns = [input() for i in range(n)]\nimport collections\n\ncounted = collections.Counter(s)\n\nm = max(counted.values())\n\nchars = []\nfor key, value in counted.items():\n if value == m:\n chars.append(key)\n\nprint(sorted(chars))\n', 'n = int(input())\ns = [input() for i in range(n)]\nimport collections\n\ncounted = collections.Counter(s)\n\nm = max(counted.values())\n\nchars = []\nfor key, value in counted.items():\n if value == m:\n chars.append(key)\nchars=sorted(chars)\n\nfor i in range(len(chars)):\n print(chars[i])\n']
['Wrong Answer', 'Accepted']
['s538283400', 's608213589']
[39300.0, 35476.0]
[546.0, 657.0]
[243, 290]
p02773
u483896240
2,000
1,048,576
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.
['# -*- coding: utf-8 -*-\n\nn = int(input())\nsl = list(input() for _ in range(n))\nsl.sort()\nsl_set = set(sl)\n\nm = 0\nl = []\nfor s in sl_set:\n a = sl.count(s)\n m = max(m, a)\n l.append(a)\n\nfor i, s in enumerate(sl_set):\n if l[i] == m:\n print(s)', '# -*- coding: utf-8 -*-\nimport numpy as np\nfrom collections import Counter\n\nn = int(input())\nsl = list(input() for _ in range(n))\nsl_dct = Counter(sl)\nm = 0\nfor i in sl_dct.values():\n m = max(m,i)\n\nsl_s = list(set(sl))\nsl_s.sort()\nfor i in sl_s:\n if sl_dct[i] == m:\n print(i)']
['Wrong Answer', 'Accepted']
['s311763828', 's515461184']
[29640.0, 52944.0]
[2105.0, 869.0]
[257, 289]
p02773
u484052148
2,000
1,048,576
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.
['n = int(input())\ns = [int(input()) for i in range(n)]\n\nl = [s.count(i) for i in s]\nd = {i:j for i,j in zip(s, l)}\nm = max(l)\n\nd = {i:j for i, j in zip(s, l)}\nans = [i for i in d if d[i] == m]\nsorted(ans)\n\nfor i in ans:\n print(i)', 'from collections import Counter\n\nn = int(input())\ns = [input() for i in range(n)]\n\nd = Counter(s)\nm = max(d.values())\nans = [i for i in d if d[i] == m]\nans = sorted(ans)\n\nfor i in ans:\n print(i)']
['Runtime Error', 'Accepted']
['s610502312', 's059029370']
[3064.0, 35572.0]
[18.0, 614.0]
[231, 197]
p02773
u485566817
2,000
1,048,576
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.
['import sys\ninput = sys.stdin.readline\n\nn = int(input())\ns = list(input() for _ in range(n))\n\ns_set = sorted(list(set(s)))\ns_num = [0]*len(s_set)\n\nfor i in range(n):\n s_num[s_set.index(s[i])] += 1\n\nans_num = max(s_num)\nfor i in range(len(s_set)):\n if s_num[i] == ans_num:\n print(s_set[i])', 'from collections import Counter\n\nn = int(input())\ns_list = sorted(list(input() for _ in range(n)))\n\ns = Counter(s_list)\n\nans_num = s.most_common(1)[0][1]\n\ns_1 = sorted(list(s.items()), key=lambda x: x[0])\n\nfor i in range(len(s_1)):\n if s_1[i][1] == ans_num:\n print(s_1[i][0])']
['Time Limit Exceeded', 'Accepted']
['s121810919', 's790693490']
[29216.0, 50284.0]
[2105.0, 1260.0]
[300, 285]
p02773
u486065927
2,000
1,048,576
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.
['n = int(input())\ns = sorted([input() for i in range(n)])\ns_ = list(set(s))\nif len(s_) != n:\n s.append(0)\n co = [1] + [0 for i in range(len(s_)-1)]\n ind = 0\n for i in range(1, n):\n if s[i-1] == s[i]:\n co[ind] += 1\n else:\n ind += 1\n co[ind] += 1\n ma = max(co)\n arg = [i for i in range(len(s_)) if co[i]==ma]\n ans = [s_[i] for i in arg]\n print("\\n".join(sorted(ans)))\n \nelse:\n print("\\n".join(s))', 'n = int(input())\ns = sorted([input() for i in range(n)])\ns_ = list(set(s))\nif len(s_) != n:\n s.append(0)\n co = [1] + [0 for i in range(len(s_)-1)]\n ind = 0\n for i in range(1, n):\n if s[i-1] == s[i]:\n co[ind] += 1\n else:\n ind += 1\n co[ind] += 1\n ma = max(co)\n arg = [i for i in range(len(s_)) if co[i]==ma]\n ans = [s_[i] for i in arg]\n print("\\n".join(sorted(ans)))\n \nelse:\n print("\\n".join(s_))', 'n = int(input())\ns = sorted([input() for i in range(n)])\ns_ = sorted(list(set(s)))\nif len(s_) != n:\n s.append(0)\n co = [1] + [0 for i in range(len(s_)-1)]\n ind = 0\n for i in range(1, n):\n if s[i-1] == s[i]:\n co[ind] += 1\n else:\n ind += 1\n co[ind] += 1\n ma = max(co)\n arg = [i for i in range(len(s_)) if co[i]==ma]\n ans = [s_[i] for i in arg]\n print("\\n".join(sorted(ans)))\n \nelse:\n print("\\n".join(s))']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s466937064', 's750102387', 's778577575']
[29604.0, 29600.0, 29608.0]
[537.0, 532.0, 627.0]
[470, 471, 478]
p02773
u486251525
2,000
1,048,576
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.
['import collections\nimport itertools\n\nN = int(input())\nL = []\nD = {}\nfor _ in range(N):\n x = input()\n L.append(x)\n\ncounter = collections.Counter(L)\n\nmode_v = counter.most_common()[0][-1]\nit = itertools.takewhile(\n lambda kv: kv[-1] == mode_v, counter.most_common()\n)\n\nprint(sorted(*(k for k, v in it)))\n', 'import collections\nimport itertools\n\nN = int(input())\nL = []\nD = {}\nfor _ in range(N):\n x = input()\n L.append(x)\n\ncounter = collections.Counter(L)\n\nmode_v = counter.most_common()[0][-1]\nit = itertools.takewhile(\n lambda kv: kv[-1] == mode_v, counter.most_common()\n)\n\nprint(*(k for k, v in it))\n', 'N = int(input())\nL = []\nD = {}\nfor _ in range(N):\n x = input()\n L.append(x)\n\nfor x in L:\n D[x] = 0\n \nfor x in L:\n D[x] += 1\n\nSortD = sorted(D.items(), key=lambda x:x[1])\nmaxD = SortD[-1][1]\nans = []\nfor x in reversed(SortD):\n if x[1] == maxD:\n ans.append(x[0])\n else:\n break\nfor x in sorted(ans):\n print(x)\n']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s045119417', 's910009042', 's932116575']
[45296.0, 45296.0, 48912.0]
[542.0, 627.0, 743.0]
[311, 303, 345]
p02773
u487594898
2,000
1,048,576
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.
['import collections\nN = int(input())\nA=[input() for i in range(N)]\nc = collections.Counter(A)\nvalues, counts = zip(*c.most_common())\nk = max (counts)\nl =counts.count(k)\nV = []\nfor i in range(l):\n V.append(values[i])\nsorted(V)\nfor j in range(len(V)):\n print(V[j])', 'import collections\nN = int(input())\nA=[input() for i in range(N)]\nc = collections.Counter(A)\nvalues, counts = zip(*c.most_common())\nk = max (counts)\nl =counts.count(k)\nV = []\nfor i in range(l):\n V.append(values[i])\nL = sorted(V)\nfor j in range(len(L)):\n print(L[j])']
['Wrong Answer', 'Accepted']
['s112171228', 's557328759']
[59504.0, 59496.0]
[899.0, 963.0]
[263, 267]
p02773
u489155878
2,000
1,048,576
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.
['#C\n\nN=int(input())\nS=[input() for i in range(N)]\n\n\nresult={}\nfor i in S:\n if i in result:\n result[i]+=1\n else:\n result[i]=1\n\n\nx=max(result.values())\n\nfor i in result.items():\n if i[1]==x:\n print(i[0])', 'n=int(input())\ns=[input() for i in range(n)]\n\nd={}\n\nfor i in s:\n if i in d:\n d[i]+=1\n else:\n d[i]=1\nd=sorted(d.items,reverse=True)\n\n\n\nfor i in d.key:\n print(i)\n', 'n=int(input())\ns=[input() for i in range(n)]\n\nd={}\n\nfor i in s:\n if i in d:\n d[i]+=1\n else:\n d[i]=1\nd=sorted(d.items(),reverse=True)\n\n\n\nfor i in d.key():\n print(i)\n', '#C\n\nN=int(input())\nS=[input() for i in range(N)]\n\n\nresult={}\nfor i in S:\n if i in result:\n result[i]+=1\n else:\n result[i]=1\n\nx=max(result.values())\nx.sort\n\nfor i in result.items():\n if i[1]==x:\n print(i[0])', 'n=int(input())\ns=[input() for i in range(n)]\n\nd={}\n\nfor i in s:\n if i in d:\n d[i]+=1\n else:\n d[i]=0\nd=sorted(d.items,reverse=True)\n\n\n\nfor i in d.key:\n print(i)', '#C\n\nN=int(input())\nS=[input() for i in range(N)]\n\n\nresult={}\nfor i in S:\n if i in result:\n result[i]+=1\n else:\n result[i]=1\n\nx=max(result.values())\n\nZ=[]\nfor i in result.items():\n if i[1]==x:\n Z.append(i[0])\nZ.sort()\nfor i in Z:\n print(i)']
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s003332978', 's018125230', 's475721485', 's602644164', 's872408376', 's879289454']
[35220.0, 35220.0, 43920.0, 35220.0, 35216.0, 35220.0]
[475.0, 338.0, 752.0, 318.0, 321.0, 658.0]
[244, 169, 173, 250, 168, 285]
p02773
u490553751
2,000
1,048,576
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.
["N = int(input())\nS = ['0'] * N\nfor i in range(N):\n S[i] = input()\nimport collections\nc = collections.Counter(S)\nli = list(c.values())\nca = list(c.keys())\nli.sort()\nmax = li[-1]\nfor i in ca:\n if c[i] == max:\n print(i)", '#template\ndef inputlist(): return [int(k) for k in input().split()]\n#template\nN = int(input())\ns = [0]*N\nfor i in range(N):\n s[i] = input()\nfrom collections import Counter\nc = Counter(s)\nli = []\nm = max(list(c.values()))\nfor i in list(c.keys()):\n if c[i] == m:\n li.append(i)\nli.sort()\nfor i in range(len(li)):\n print(li[i])']
['Wrong Answer', 'Accepted']
['s878270548', 's079234304']
[35560.0, 35560.0]
[494.0, 738.0]
[229, 339]
p02773
u491762407
2,000
1,048,576
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.
['import collections\nn = int(input())\ns=[input() for i in range(n)]\nans = []\n\n\nc = collections.Counter(s)\nk = c.most_common()\n\n\nif n == 1:\n print(s[0])\nelif n >= 2 and len(c.keys()) == 1:\n print(c.most_common()[0][0])\nfor i in range(len(k)):\n if k[0][0] == k[i][1]:\n ans.append(k[i][0])\n else:\n break\n \nans.sort()\nprint(*ans, sep="\\n")\n', 'import collections\nn = int(input())\ns=[input() for i in range(n)]\nans = list()\n\n\nc = collections.Counter(s)\nk = c.most_common()\n\n\nif n == 1:\n print(s[0])\nelif n >= 2 and len(c.keys()) == 1:\n print(c.most_common()[0][0])\nfor i in range(k):\n if k[0][0] == k[i][1]:\n ans.append(k[i][0])\n else:\n break\n \nans = sorted(ans)\n[print(i) for i in ans]', 'import collections\nn = int(input())\ns=[input() for i in range(n)]\nans = list()\n\n\nc = collections.Counter(s)\nk = c.most_common()\n\n\nif n == 1:\n print(s[0])\nelif n >= 2 and len(c.keys()) == 1:\n print(c.most_common()[0][0])\nfor i in range(len(k)):\n if k[0][0] == k[i][1]:\n ans.append(k[i][0])\n else:\n break\n \nans = sorted(ans)\n[print(i) for i in ans]', 'import collections\nn = int(input())\ns=[input() for i in range(n)]\nans = list()\n\nc = collections.Counter(s)\n\nm = max(c.values())\nfor k,v in c.items():\n if v ==m:\n ans.append(k)\nans.sort()\nprint(*ans,sep="\\n")']
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s234209160', 's260916936', 's684511174', 's499795997']
[45040.0, 45124.0, 45040.0, 35824.0]
[410.0, 401.0, 394.0, 620.0]
[367, 374, 379, 217]
p02773
u493130708
2,000
1,048,576
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.
['N = int(input())\n\ndic = set()\nfor i in range(N):\n dic.add(str(input()))\n\ndic = list(dic)\ndic.sort()\n\nfor i in dic:\n print(i)', 'N = int(input())\n\ndic = set()\nfor i in range(N):\n dic.add(str(input()))\n\ndic.sort()\n\nfor i in list(dic):\n print(i)', 'N = int(input())\n\ndic = {}\nfor i in range(N):\n if i not in dic:\n dic[i] = 1\n else:\n dic[i] = dic[i]+1\n\nl = dic.items()\nmax = 0\nfor i in l:\n if i[1] > max:\n max = i[1]\n\nresult = []\nfor i in l:\n if i[1] == max:\n result.append(i[0])\n\nresult.sort()\n\nfor i in result:\n print(i)', 'N = int(input())\n\n\ninin = []\nfor i in range(N):\n inin.append(str(input()))\n \ndic = {}\nfor i in inin:\n if i not in dic:\n dic[i] = 1\n else:\n dic[i] = dic[i]+1\n\nl = dic.items()\nmax = 0\nfor i in l:\n if i[1] > max:\n max = i[1]\n\nresult = []\nfor i in l:\n if i[1] == max:\n result.append(i[0])\n\nresult.sort()\n\nfor i in result:\n print(i)']
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s266752761', 's717010500', 's734274238', 's591320350']
[25832.0, 25832.0, 27112.0, 35208.0]
[615.0, 391.0, 281.0, 853.0]
[130, 120, 315, 376]
p02773
u493318999
2,000
1,048,576
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.
['from collections import Counter\nn = int(input())\ns = [input() for _ in range(n)]\nc = Counter(s)\nd = c.most_common()\ncntmax = d[0][1]\nl = [i[0] for i in c.items() if i[1] >= cntmax]\nfor i in range(len(l)):\n print(l[i])', 'import collections\n\nn = int(input())\ns = []\nfor i in range(n):\n si = input()\n s.append(si)\n\nstr = collections.Counter(s)\ncntmax = str.most_common()[0][1]\n\nslist = list(str.items())\n\nans = []\nfor i in range(len(set(s))):\n if slist[i][1] == cntmax:\n ans.append(slist[i][0])\nans.sort()\n\nfor i in range(len(ans)):\n print(ans[i])']
['Wrong Answer', 'Accepted']
['s351648593', 's030182385']
[47036.0, 58480.0]
[587.0, 796.0]
[220, 342]
p02773
u496815777
2,000
1,048,576
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.
['n = int(input())\ns = []\nfor i in range(n):\n s.append(input())\n\nwords = []\ncnt = dict()\nfor i in range(n):\n if s[i] not in words:\n words.append(s[i])\n cnt[s[i]] = 1\n else:\n cnt[s[i]] += 1\n\ncnt_sorted = sorted(cnt.items(), key=lambda x:x[1], reverse=True)\nfor j in range(len(cnt_sorted)):\n if cnt_sorted[j][1] == cnt_sorted[0][1]:\n print(cnt_sorted[j][0])\n else:\n break', 'n = int(input())\ns = []\nfor i in range(n):\n s.append(input())\n\nwords = set()\ncnt = dict()\nfor i in range(n):\n if s[i] not in words:\n words.add(s[i])\n cnt[s[i]] = 1\n else:\n cnt[s[i]] += 1\n\ntop_words = []\nmax_val = 0\nfor k, v in cnt.items():\n if v > max_val:\n max_val = v\n top_words = [k]\n elif v == max_val:\n top_words.append(k)\n\ntop_words =sorted(top_words)\nfor i in range(len(top_words)):\n print(top_words[i])']
['Wrong Answer', 'Accepted']
['s922964281', 's445857482']
[18104.0, 43356.0]
[2104.0, 827.0]
[387, 434]
p02773
u497952650
2,000
1,048,576
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.
['N = int(input())\nS = []\n\nfor i in range(N):\n tmp = input()\n S.append(tmp)\nS.sort()\nif N == 1:\n print(S[0])\n exit()\nans = []\nSS = []\ncount = 1\nprint(S)\nfor i in range(N-1):\n if i == N-2:\n if S[i] == S[i+1]:\n count += 1\n ans.append(count)\n SS.append(S[i])\n else:\n ans.append(count)\n SS.append(S[i])\n ans.append(1)\n SS.append(S[i+1])\n elif S[i] == S[i+1]:\n count += 1\n else:\n ans.append(count)\n SS.append(S[i])\n count = 1\n\nm = max(ans)\n\nfor i in range(len(SS)):\n if ans[i] == m:\n print(SS[i])', 'from collections import Counter\n\nN = int(input())\nS = []\nfor i in range(N):\n S.append(input())\n\ncount = Counter(S).most_common()\nmode = count[0][1]\ncount.sort()\n##print("--")\nfor i in range(len(count)):\n if count[i][1] == mode:\n print(count[i][0])\n']
['Wrong Answer', 'Accepted']
['s686461458', 's425067361']
[26772.0, 45036.0]
[778.0, 921.0]
[639, 261]
p02773
u498620941
2,000
1,048,576
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.
["def main():\n N = int(input())\n S = [input() for _ in range(N)]\n dict = {}\n for i in range(N):\n if S[i] not in dict:\n dict[S[i]] = 1\n else:\n dict[S[i]] += 1\n ans = {}\n p = 0\n for i ,j in dict.items():\n if p < j : p = j\n\n if j not in ans:\n ans[j] = [i]\n else:\n ans[j].append(i)\n for i in range(len(ans[p])):\n print(ans[p][i])\nif __name__ == '__main__':\n main()\n", "def main():\n N = int(input())\n S = [input() for _ in range(N)]\n dict = {}\n for i in range(N):\n if S[i] not in dict:\n dict[S[i]] = 1\n else:\n dict[S[i]] += 1\n ans = {}\n p = 0\n for i ,j in dict.items():\n if p < j : p = j\n\n if j not in ans:\n ans[j] = [i]\n else:\n ans[j].append(i)\n ans[p].sort()\n for i in range(len(ans[p])):\n print(ans[p][i])\nif __name__ == '__main__':\n main()\n"]
['Wrong Answer', 'Accepted']
['s860968752', 's135822321']
[35216.0, 35220.0]
[536.0, 655.0]
[472, 490]
p02773
u499106786
2,000
1,048,576
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.
['num = int(input())\ni = [int(input()) for _ in range(num)]\n\ncount_dict = {}\nfor ele in i:\n if ele not in count_dict:\n count_dict[ele] = 1\n else:\n count_dict[ele] += 1\n \nmax_count = max(count_dict.values())\nmax_str = [a for a in count_dict if count_dict[a] == max_count]\nfor string in sorted(max_str):\n print(string)', 'num = int(input())\ni = [int(input()) for _ in range(num)]\n\ncount_dict = {}\nfor ele in i:\n if ele not in count_dict:\n count_dict[ele] = 1\n else:\n count_dict[ele] += 1\n\nmax_count = max(count_dict.values())\nmax_str = [a for a in count_dict if count_dict[a] == max_count]\nfor string in sorted(max_str):\n print(string)', 'num = int(input())\ni = [input() for _ in range(num)]\n \ncount_dict = {}\nfor ele in i:\n if ele not in count_dict:\n count_dict[ele] = 1\n else:\n count_dict[ele] += 1\n \nmax_count = max(count_dict.values())\nmax_str = [a for a in count_dict if count_dict[a] == max_count]\nfor string in sorted(max_str):\n print(string)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s502831740', 's729091890', 's506471628']
[3064.0, 3064.0, 35220.0]
[18.0, 19.0, 646.0]
[326, 322, 319]
p02773
u501451051
2,000
1,048,576
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.
['import collections\n\nN = int(input())\nS = [input() for _ in range(N)]\n\ns = collections.Counter(S)\n\nmax_val = max(s.values())\n\nfor key, value in s.items():\n if value == max_val:\n print(key)', 'N = int(input())\nS = [input() for _ in range(N)]\n \ns = {}\n\nfor i in S:\n if i in s:\n s[i] += 1\n else:\n s[i] = 1\n \nmax_val = max(s.values())\n \nfor key, value in s.items():\n if value == max_val:\n print(key)', 'from collections import defaultdict\n\nN = int(input())\nS = [input() for _ in range(N)]\n \nd = defaultdict(int)\nfor k in S:\n d[k] += 1\n\nmax_val = max(d.values())\nkeys_of_max_val = [key for key in d if d[key] == max_val]\n\nfor i in keys_of_max_val:\n print(i)', 'from collections import defaultdict, Counter\n\nn = int(input())\nlis = [input() for _ in range(n)]\n\na = Counter(lis)\n\ntmp = 0\nfor key, value in a.items():\n tmp = max(value, tmp)\n\nans =[]\nfor k, v in a.items():\n if v == tmp:\n ans.append(k)\n\nfor i in sorted(ans):\n print(i)']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s432652115', 's647851746', 's694622349', 's315584404']
[35572.0, 35220.0, 35560.0, 38764.0]
[497.0, 469.0, 535.0, 485.0]
[191, 215, 256, 286]
p02773
u508061226
2,000
1,048,576
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.
['import collections\n\nn = int(input());\nS = [];\n\nfor i in range(n):\n S.append(input());\n\nc = collections.Counter(S)\n\nnum = c.most_common()[0][1];\nans = [];\n\nfor i in range(len(c)):\n if c.most_common()[i][1] == num:\n ans.append(c.most_common()[i][0]);\n continue;\n \n else:\n break;\n \nfor a in len(ans):\n print(ans[a]);', 'import collections\n\nn = int(input());\nS = [];\n\nfor i in range(n):\n S.append(input());\n\nc = collections.Counter(S)\n\nnum = c.most_common()[0][1];\nans = [];\n\nfor i in range(len(c)):\n if c.most_common()[i][1] == num:\n ans.append(c.most_common()[i][0]);\n continue;\n \n else:\n break;\n \nfor a in range(len(ans)):\n print(ans[a]);', 'import collections\n\nn = int(input());\nS = [];\n\nfor i in range(n):\n S.append(input());\n\nc = collections.Counter(S)\n\nnum = c.most_common()[0][1];\nans = [];\n\nfor i in range(len(c)):\n if c.most_common()[i][1] == num:\n ans.append(c.most_common()[i][0]);\n continue;\n \n else:\n break;\n \nfor a in len(ans):\n print(ans[a]);\n', 'import collections\n\nn = int(input());\nS = [];\n\nfor i in range(n):\n S.append(input());\n\nc = collections.Counter(S)\ndic2 = sorted(dic.items())\n\nnum = c.most_common()[0][1];\nans = [];\n\nfor a,b in c.most_common():\n if b == num:\n ans.append(a);\n continue;\n \n else:\n break;\n\ndic2 = sorted(ans);\n\nfor i in ans:\n print(i);', 'import collections\n\nn = int(input());\nS = [];\n\nfor i in range(n):\n S.append(input());\n\nc = collections.Counter(S)\n\nnum = c.most_common()[0][1];\nans = [];\n\nfor a,b in c.most_common():\n if b == num:\n ans.append(a);\n continue;\n \n else:\n break;\n\nans = sorted(ans);\n\nfor i in ans:\n print(i);\n']
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s208106750', 's713950884', 's760288122', 's885977348', 's002787748']
[45044.0, 45040.0, 45040.0, 35564.0, 45040.0]
[2108.0, 2106.0, 2106.0, 316.0, 799.0]
[332, 339, 333, 340, 313]
p02773
u508164527
2,000
1,048,576
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.
['N = int(input())\nS =[]\ntimes = {}\nfor i in range(N):\n word = input()\n if word in times:\n times[word] = times[word] + 1\n else:\n times[word] = 1\nprint(times)\nmax_k_list = [kv[0] for kv in times.items() if kv[1] == max(times.values())]\nnew_str_list = sorted(max_k_list)\nfor i in new_str_list:\n print(i)', 'N = int(input())\nS =[]\ntimes = {}\nfor i in range(N):\n word = input()\n if word in times:\n times[word] = times[word] + 1\n else:\n times[word] = 1\nmax_value = max(times.values())\nwords = []\nfor i in times.items():\n if i[1] == max_value:\n words.append(i[0])\nwords = sorted(words)\nfor i in words:\n print(i)']
['Wrong Answer', 'Accepted']
['s440282666', 's626520200']
[36060.0, 32988.0]
[2105.0, 664.0]
[309, 314]
p02773
u509392332
2,000
1,048,576
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.
['N = int(input())\ndictionary = {}\nfor i in range(N):\n S = input()\n if S not in dictionary.keys():\n dictionary[S] = 1\n else:\n dictionary[S] += 1\n\n\nvalue_max = max(dictionary.values())\n\nmax_list = []\nfor k, v in dictionary.items():\n if v == value_max:\n max_list.append(k)\n\nfor i in max_list:\n print(i)', 'N = int(input())\ndictionary = {}\nfor i in range(N):\n S = input()\n if S not in dictionary.keys():\n dictionary[S] = 1\n else:\n dictionary[S] += 1\n\n\nvalue_max = max(dictionary.values())\n\nmax_list = []\nfor k, v in dictionary.items():\n if v == value_max:\n max_list.append(k)\n\nmax_list.sort()\nfor i in max_list:\n print(i)']
['Wrong Answer', 'Accepted']
['s889308459', 's574128650']
[32096.0, 32096.0]
[559.0, 669.0]
[334, 350]
p02773
u509739538
2,000
1,048,576
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.
['import math\nimport queue\nfrom collections import defaultdict\n\ndef readInt():\n\treturn int(input())\ndef readInts():\n\treturn list(map(int, input().split()))\ndef readChar():\n\treturn input()\ndef readChars():\n\treturn input().split()\ndef factorization(n):\n\tres = []\n\tif n%2==0:\n\t\tres.append(2)\n\tfor i in range(3,math.floor(n//2)+1,2):\n\t\tif n%i==0:\n\t\t\tc = 0\n\t\t\tfor j in res:\n\t\t\t\tif i%j==0:\n\t\t\t\t\tc=1\n\t\t\tif c==0:\n\t\t\t\tres.append(i)\n\treturn res\ndef fact2(n):\n\tp = factorization(n)\n\tres = []\n\tfor i in p:\n\t\tc=0\n\t\tz=n\n\t\twhile 1:\n\t\t\tif z%i==0:\n\t\t\t\tc+=1\n\t\t\t\tz/=i\n\t\t\telse:\n\t\t\t\tbreak\n\t\tres.append([i,c])\n\treturn res\ndef fact(n):\n\tans = 1\n\tm=n\n\tfor _i in range(n-1):\n\t\tans*=m\n\t\tm-=1\n\treturn ans\ndef comb(n,r):\n\tif n<r:\n\t\treturn 0\n\tl = min(r,n-r)\n\tm=n\n\tu=1\n\tfor _i in range(l):\n\t\tu*=m\n\t\tm-=1\n\treturn u//fact(l)\ndef combmod(n,r,mod):\n\treturn (fact(n)/fact(n-r)*pow(fact(r),mod-2,mod))%mod\ndef printQueue(q):\n\tr=qb\n\tans=[0]*r.qsize()\n\tfor i in range(r.qsize()-1,-1,-1):\n\t\tans[i] = r.get()\n\tprint(ans)\ndef dq():\n\treturn queue.deque()\nclass UnionFind():\n\tdef __init__(self, n):\n\t\tself.n = n\n\t\tself.parents = [-1]*n\n\n\tdef find(self, x): # root\n\t\tif self.parents[x]<0:\n\t\t\treturn x\n\t\telse:\n\t\t\tself.parents[x] = self.find(self.parents[x])\n\t\t\treturn self.parents[x]\n\n\tdef union(self,x,y):\n\t\tx = self.find(x)\n\t\ty = self.find(y)\n\n\t\tif x==y:\n\t\t\treturn\n\n\t\tif self.parents[x]>self.parents[y]:\n\t\t\tx,y = y,x\n\n\t\tself.parents[x]+=self.parents[y]\n\t\tself.parents[y]=x\n\n\tdef size(self,x):\n\t\treturn -1*self.parents[self.find(x)]\n\n\tdef same(self,x,y):\n\t\treturn self.find(x)==self.find(y)\n\n\tdef members(self,x): # much time\n\t\troot = self.find(x)\n\t\treturn [i for i in range(self.n) if self.find(i)==root]\n\n\tdef roots(self):\n\t\treturn [i for i,x in enumerate(self.parents) if x<0]\n\n\tdef group_count(self):\n\t\treturn len(self.roots())\n\n\tdef all_group_members(self):\n\t\treturn {r: self.members(r) for r in self.roots()} # 1~n\ndef bitArr(n):\n\tx = 1\n\tzero = "0"*n\n\tans = []\n\tans.append([0]*n)\n\tfor i in range(2**n-1):\n\t\tans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))\n\t\tx+=1\n\treturn ans;\ndef arrsSum(a1,a2):\n\tfor i in range(len(a1)):\n\t\ta1[i]+=a2[i]\n\treturn a1\ndef maxValue(a,b,v):\n\tv2 = v\n\tfor i in range(v2,-1,-1):\n\t\tfor j in range(v2//a+1): \n\t\t\tk = i-a*j\n\t\t\tif k%b==0:\n\t\t\t\treturn i\n\treturn -1\n\n\nn = readInt()\nd = defaultdict(int)\nfor i in range(n):\n\td[readChar()]+=1\n\nd = sorted(d.items(), key=lambda x:x[1], reverse=True)\nmaxCount = d[0][1]\n\n\n\nfor i in range(len(d)):\n\tif d[i][1]==maxCount:\n\t\tprint(d[i][0])\n\telse:\n\t\tbreak', 'import math\nimport queue\nfrom collections import defaultdict\n\ndef readInt():\n\treturn int(input())\ndef readInts():\n\treturn list(map(int, input().split()))\ndef readChar():\n\treturn input()\ndef readChars():\n\treturn input().split()\ndef factorization(n):\n\tres = []\n\tif n%2==0:\n\t\tres.append(2)\n\tfor i in range(3,math.floor(n//2)+1,2):\n\t\tif n%i==0:\n\t\t\tc = 0\n\t\t\tfor j in res:\n\t\t\t\tif i%j==0:\n\t\t\t\t\tc=1\n\t\t\tif c==0:\n\t\t\t\tres.append(i)\n\treturn res\ndef fact2(n):\n\tp = factorization(n)\n\tres = []\n\tfor i in p:\n\t\tc=0\n\t\tz=n\n\t\twhile 1:\n\t\t\tif z%i==0:\n\t\t\t\tc+=1\n\t\t\t\tz/=i\n\t\t\telse:\n\t\t\t\tbreak\n\t\tres.append([i,c])\n\treturn res\ndef fact(n):\n\tans = 1\n\tm=n\n\tfor _i in range(n-1):\n\t\tans*=m\n\t\tm-=1\n\treturn ans\ndef comb(n,r):\n\tif n<r:\n\t\treturn 0\n\tl = min(r,n-r)\n\tm=n\n\tu=1\n\tfor _i in range(l):\n\t\tu*=m\n\t\tm-=1\n\treturn u//fact(l)\ndef combmod(n,r,mod):\n\treturn (fact(n)/fact(n-r)*pow(fact(r),mod-2,mod))%mod\ndef printQueue(q):\n\tr=qb\n\tans=[0]*r.qsize()\n\tfor i in range(r.qsize()-1,-1,-1):\n\t\tans[i] = r.get()\n\tprint(ans)\ndef dq():\n\treturn queue.deque()\nclass UnionFind():\n\tdef __init__(self, n):\n\t\tself.n = n\n\t\tself.parents = [-1]*n\n\n\tdef find(self, x): # root\n\t\tif self.parents[x]<0:\n\t\t\treturn x\n\t\telse:\n\t\t\tself.parents[x] = self.find(self.parents[x])\n\t\t\treturn self.parents[x]\n\n\tdef union(self,x,y):\n\t\tx = self.find(x)\n\t\ty = self.find(y)\n\n\t\tif x==y:\n\t\t\treturn\n\n\t\tif self.parents[x]>self.parents[y]:\n\t\t\tx,y = y,x\n\n\t\tself.parents[x]+=self.parents[y]\n\t\tself.parents[y]=x\n\n\tdef size(self,x):\n\t\treturn -1*self.parents[self.find(x)]\n\n\tdef same(self,x,y):\n\t\treturn self.find(x)==self.find(y)\n\n\tdef members(self,x): # much time\n\t\troot = self.find(x)\n\t\treturn [i for i in range(self.n) if self.find(i)==root]\n\n\tdef roots(self):\n\t\treturn [i for i,x in enumerate(self.parents) if x<0]\n\n\tdef group_count(self):\n\t\treturn len(self.roots())\n\n\tdef all_group_members(self):\n\t\treturn {r: self.members(r) for r in self.roots()} # 1~n\ndef bitArr(n):\n\tx = 1\n\tzero = "0"*n\n\tans = []\n\tans.append([0]*n)\n\tfor i in range(2**n-1):\n\t\tans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))\n\t\tx+=1\n\treturn ans;\ndef arrsSum(a1,a2):\n\tfor i in range(len(a1)):\n\t\ta1[i]+=a2[i]\n\treturn a1\ndef maxValue(a,b,v):\n\tv2 = v\n\tfor i in range(v2,-1,-1):\n\t\tfor j in range(v2//a+1): \n\t\t\tk = i-a*j\n\t\t\tif k%b==0:\n\t\t\t\treturn i\n\treturn -1\n\n\nn = readInt()\nd = defaultdict(int)\nfor i in range(n):\n\td[readChar()]+=1\n\nd = sorted(d.items(), key=lambda x:x[1], reverse=True)\nmaxCount = d[0][1]\n\nans = []\n\nfor i in range(len(d)):\n\tif d[i][1]==maxCount:\n\t\tans.append(d[i][0])\n\telse:\n\t\tbreak\n\nans.sort()\n\nfor i in range(len(ans)):\n\tprint(ans[i])']
['Wrong Answer', 'Accepted']
['s763438755', 's514513125']
[44112.0, 44112.0]
[690.0, 954.0]
[2558, 2625]
p02773
u511870776
2,000
1,048,576
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.
['import collections\nN = int(input())\nS_list = [input() for i in range(N)]\nc = collections.Counter(S_list)\nl = {}\nfor x, y in zip(*c):\n if x in l.keys():\n l[x] = [y]\n else:\n l[x].append(y)\n\nfor x in sorted(l.keys(), reverse=True):\n for y in sorted(l[x]):\n print(y)\n\n\n', 'import collections\nN = int(input())\nS_list = [input() for i in range(N)]\nc = collections.Counter(S_list)\nl = {}\nm = c[0][0]\nfor x, y in zip(*c):\n if x in l.keys():\n l[x] = [y]\n else:\n l[x].append(y)\n\n \nfor y in sorted(l[m]):\n print(y)', 'N = int(input())\n\nvalue_dict = {}\n\nfor x in range(N):\n value = input()\n if value not in value_dict.keys():\n value_dict[value] = 1\n continue\n value_dict[value] += 1\n\nmax_count = max(value_dict.values())\nmax_values = [k for k, v in value_dict.items() if v == max_count]\nmax_values.sort()\n\n\nprint("\\n".join(max_values))\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s619841956', 's685218775', 's676875032']
[46580.0, 35572.0, 34140.0]
[442.0, 317.0, 550.0]
[277, 244, 340]
p02773
u512099209
2,000
1,048,576
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.
['N = int(input())\n\nS = [None] * N\n\nm = dict()\n\nfor i in range(N):\n s = input()\n if not s in m.keys():\n m[s] = 1\n else:\n m[s] += 1\n\nmax_cnt = max(m.values())\n\nret = []\n\nfor k, v in sorted(m.items(), key=lambda x: x[1], reverse=True):\n if v < max_cnt:\n break\n ret.append(k)\n\nret.sort()\nprint(ret)', 'N = int(input())\n \nS = [None] * N\n \nm = dict()\n \nfor i in range(N):\n s = input()\n if not s in m.keys():\n m[s] = 1\n else:\n m[s] += 1\n \nmax_cnt = max(m.values())\n \nret = []\n \nfor k, v in sorted(m.items(), key=lambda x: x[1], reverse=True):\n if v < max_cnt:\n break\n ret.append(k)\n \nret.sort()\nfor s in ret:\n print(s)']
['Wrong Answer', 'Accepted']
['s197482691', 's103660252']
[44764.0, 44764.0]
[689.0, 731.0]
[307, 328]
p02773
u514118270
2,000
1,048,576
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.
["from collections import Counter\nN = int(input())\nA = []\nfor i in range(N):\n A.append(input())\nC= Counter(A)\nB = 0\nfor v in c.values():\n B = max(B,v)\nans = []\nfor k, v in c.items()\n if v == B:\n ans.append(k)\nans.sort()\nprint(*ans,sep='\\n')", "from collections import Counter\nN = int(input())\nA = []\nfor i in range(N):\n A.append(input())\nC= Counter(A)\nB = 0\nfor v in c.values():\n B = max(B,v)\nans = []\nfor k, v in c.items():\n if v == B:\n ans.append(k)\nans.sort()\nprint(*ans,sep='\\n')", "from collections import Counter\nN = int(input())\nA = []\nfor i in range(N):\n A.append(input())\nC= Counter(A)\nB = 0\nfor v in C.values():\n B = max(B,v)\nans = []\nfor k, v in C.items():\n if v == B:\n ans.append(k)\nans.sort()\nprint(*ans,sep='\\n')"]
['Runtime Error', 'Runtime Error', 'Accepted']
['s241862994', 's892481348', 's827109530']
[2940.0, 35572.0, 35824.0]
[17.0, 317.0, 648.0]
[244, 245, 245]
p02773
u516566941
2,000
1,048,576
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.
['import collections\nN = int(input())\nl = []\nfor _ in range(N):\n s = input()\n l.append(s)\nc = collections.Counter(l)\ni=0\nj=0\nwhile True:\n print(c.most_common()[i][0])\n if i+1<len(c.most_common()):\n if c.most_common()[i+1][1] == c.most_common()[i][1]:\n i+=1\n continue\n else:\n break\n else:\n break\n', 'from collections import defaultdict\nN = int(input())\ntouhyou = defaultdict(int)\nfor _ in range(N):\n s = input()\n touhyou[s] +=1\ntouhyou1=dict(sorted(touhyou.items(),key = lambda x: x[1],reverse = True))\nmaxn=max(touhyou1.values())\nans=[]\nfor key,val in zip(touhyou1.keys(),touhyou1.values()):\n if val == maxn:\n ans.append(key)\n\nans=sorted(ans)\n\nfor i in range(len(ans)):\n print(ans[i])']
['Wrong Answer', 'Accepted']
['s663537661', 's164283334']
[45152.0, 66524.0]
[2106.0, 923.0]
[362, 404]
p02773
u518891382
2,000
1,048,576
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.
['from collections import Counter\n\nn = int(input())\nst = []\nfor _ in range(n):\n st.append(input())\ns = Counter(st)\ns = s.most_common()\n\nmax = s[0][1]\nmax_s = []\n\nfor i in range(len(s)):\n if int(s[i][1]) == int(max):\n max_s.append(s[i][0])\nmax_s.sort()\nprint(max_s)', 'from collections import Counter\n\nn = int(input())\nst = []\nfor _ in range(n):\n st.append(input())\ns = Counter(st)\ns = s.most_common()\n\nmax = s[0][1]\nmax_s = []\n\nfor i in range(len(s)):\n if int(s[i][1]) == int(max):\n max_s.append(s[i][0])\nmax_s.sort()\n\nfor i in range(len(max_s)):\n print(max_s[i])']
['Wrong Answer', 'Accepted']
['s552011489', 's796908668']
[49484.0, 49524.0]
[492.0, 530.0]
[275, 311]
p02773
u519787311
2,000
1,048,576
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.
["import sys #sys.stdin.readline()\nimport heapq #heap\nfrom collections import defaultdict\nfastinp = lambda: sys.stdin.readline().split(' ')[0].split('\\n')\ninp = lambda: input().split(' ')\nml = lambda x, y=int: list(map(y, x))\ndebug = lambda *args: print(*args, sep=' | ')\nn = int(fastinp()[0])\nhmap = defaultdict(int)\nfor i in range(n):\n hmap[fastinp()[0]] += 1\nm = 0\nfor k, v in hmap.items():\n m = max(m, v)\nfor k, v in hmap.items():\n if v == m:\n print(k)\n", "import sys #sys.stdin.readline()\nimport heapq #heap\nfrom collections import defaultdict\nfastinp = lambda: sys.stdin.readline().split(' ')[0].split('\\n')\ninp = lambda: input().split(' ')\nml = lambda x, y=int: list(map(y, x))\ndebug = lambda *args: print(*args, sep=' | ')\nn = int(fastinp()[0])\nhmap = defaultdict(int)\nfor i in range(n):\n hmap[fastinp()[0]] += 1\nm = 0\nfor k, v in hmap.items():\n m = max(m, v)\nlist = []\nfor k, v in hmap.items():\n if v == m:\n list.append(k)\nprint(*sorted(list), sep='\\n')\n"]
['Wrong Answer', 'Accepted']
['s038962136', 's170030453']
[32476.0, 34256.0]
[497.0, 733.0]
[471, 518]
p02773
u519968172
2,000
1,048,576
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.
['n=int(input())\na={}\nfor _ in range(n):\n m=input()\n if m in a:\n a[m]+=1\n else:\n a[m]=1\nfor k in a.items() :\n if k[1] == max(a.values()):\n print(k[0])', 'n=int(input())\na={}\nfor _ in range(n):\n m=input()\n if m in a:\n a[m]+=1\n else:\n a[m]=1\nb=[]\nv=max(a.values())\nfor k in a.items() :\n if k[1] == v:\n b.append(k[0])\nb.sort()\nfor l in b:\n print(l)']
['Wrong Answer', 'Accepted']
['s568262660', 's822620721']
[32096.0, 32092.0]
[2104.0, 638.0]
[166, 210]
p02773
u520843951
2,000
1,048,576
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.
["from collections import Counter\n\nn = int(input())\ns = [input() for _ in range(n)]\n\ncounter = Counter(s)\ncount = counter.most_common()\nprint(counter, count)\nmost = count[0][1]\n\nc = []\nfor i in range(len(count)):\n print(count[i][1])\n if most == count[i][1]:\n c.append(count[i][0])\n\nc.sort()\nprint(*c, sep='\\n')", "from collections import Counter\n\nn = int(input())\ns = [input() for _ in range(n)]\n\ncounter = Counter(s)\ncount = counter.most_common()\nmost = count[0][1]\n\nc = []\nfor i in range(len(count)):\n print(count[i][1])\n if most == count[i][1]:\n c.append(count[i][0])\n\nc.sort()\nprint(*c, sep='\\n')", "from collections import Counter\n\nn = int(input())\ns = [input() for _ in range(n)]\n\ncounter = Counter(s)\ncount = counter.most_common()\nmost = count[0][1]\n\nc = []\nfor i in range(len(count)):\n if most == count[i][1]:\n c.append(count[i][0])\n\nc.sort()\nprint(*c, sep='\\n')"]
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s194821581', 's940320706', 's077402589']
[72116.0, 51200.0, 50196.0]
[1046.0, 832.0, 725.0]
[321, 299, 276]
p02773
u521271655
2,000
1,048,576
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.
['N = int(input())\ndic = {}\nfor i in range(1,N+1):\n key = input()\n if key not in dic:\n dic[key] = 1\n else:\n dic[key] += 1\nlis = []\nfor key,val in dic.items():\n lis.append([val,key])\nlis.sort(reverse = True)\n\nlis2 = []\nfnum = lis[0][0]\nj = 0\nfor x in range(0,len(lis)): \n if lis[j][0] == fnum:\n lis2.append(lis[j][1])\n else:\n break\nlis2.sort()\nfor k in lis2:\n print(k)\n ', 'N = int(input())\ndic = {}\nfor i in range(1,N+1):\n key = input()\n if key not in dic:\n dic[key] = 1\n else:\n dic[key] += 1\nlis = []\nfor key,val in dic.items():\n lis.append([val,key])\nlis.sort(reverse = True)\n\nlis2 = []\nfnum = lis[0][0]\n\nfor j in range(0,len(lis)): \n if lis[j][0] == fnum:\n lis2.append(lis[j][1])\n else:\n break\nlis2.sort()\nfor k in lis2:\n print(k)\n ']
['Wrong Answer', 'Accepted']
['s312011875', 's159224665']
[52568.0, 52188.0]
[1020.0, 1167.0]
[419, 414]
p02773
u521518741
2,000
1,048,576
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.
["def resolve():\n N = int(input())\n arr = list(map(int, input().split()))\n for num in arr:\n if not num % 2 and not (num % 3 == 0 or num % 5 == 0):\n print('DENIED')\n quit()\n print('APPROVED')\n\nresolve()", 'def resolve():\n N = int(input())\n from collections import defaultdict\n cnt = defaultdict(int)\n for _ in range(N):\n cnt[input()] += 1\n items = sorted(cnt.items(), key=lambda x: (-x[1], x[0]))\n max_v = items[0][1]\n for item in items:\n if max_v != item[1]:\n break\n print(item[0])\n\nresolve()']
['Runtime Error', 'Accepted']
['s527546232', 's641462828']
[3060.0, 59492.0]
[17.0, 1046.0]
[240, 340]
p02773
u524255742
2,000
1,048,576
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.
['from collections import *\nN = int(input())\ncount = Counter(input().split())\n\n\nm = max(count.values())\n\n\nans = [a for a,b in count.items() if b == m]\nans.sort()\nfor S in ans:\n print(S)', 'from collections import *\nN = int(input())\ncount = Counter([ input() for _ in range(N)])\n\nm = max(count.values())\n\nans = [a for a,b in count.items() if b == m]\nans.sort()\nfor S in ans:\n print(S)']
['Wrong Answer', 'Accepted']
['s335053910', 's243219437']
[3316.0, 35568.0]
[21.0, 656.0]
[186, 197]
p02773
u524489226
2,000
1,048,576
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.
['n = int(input())\nlist_a = []\n\nfor i in range(n):\n list_a.append(input())\n\nd = {}\nfor i in list_a:\n if i in d:\n d[i] = d[i] + 1\n else:\n d[i] = 1\n\nkey = [k for k, v in d.items() if v == d[max(d)]]\nfor i in key:\n print(i)', '# n = int(input())\n# list_a = []\n\n\n# list_a.append(input())\n\n# d = {}\n\n\n# d[i] = d[i] + 1\n# else:\n# d[i] = 1\n\n\n\n# print(i)\n\n \nn = int(input())\nlist_a = []\n\nd = {}\nfor _ in range(n):\n i = input()\n if i in d:\n d[i] += 1\n else:\n d[i] = 1\n\nmax_value = max(d.values())\nkey = sorted([k for k, v in d.items() if v == max_value])\nfor i in key:\n print(i)\n']
['Wrong Answer', 'Accepted']
['s977242549', 's882586483']
[35216.0, 32988.0]
[2105.0, 624.0]
[228, 513]
p02773
u524870111
2,000
1,048,576
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.
['import sys\nstdin = sys.stdin\nfrom collections import defaultdict\n\nns = lambda: stdin.readline().rstrip()\nni = lambda: int(ns())\nna = lambda: list(map(int, stdin.readline().split()))\n\nn = ni()\nd = defaultdict(int)\nfor _ in range(n):\n s = ns()\n d[s] += 1\nd = sorted(d.items(), key = lambda x:x[1], reverse=True)\nki, vi = d[0]\nprint(ki)\nfor k, v in d[1:]:\n if v == vi:\n print(k)\n else:\n quit()', 'import sys\nstdin = sys.stdin\nfrom collections import defaultdict\n\nns = lambda: stdin.readline().rstrip()\nni = lambda: int(ns())\nna = lambda: list(map(int, stdin.readline().split()))\n\nn = ni()\nd = defaultdict(int)\nfor _ in range(n):\n s = ns()\n d[s] += 1\nd = sorted(d.items(), key = lambda x:x[1], reverse=True)\nki, vi = d[0]\nk = [ki]\nfor ki, v in d[1:]:\n if v == vi:\n k.append(ki)\nk.sort()\nfor ki in k:\n print(ki)\n']
['Wrong Answer', 'Accepted']
['s262653526', 's636216984']
[43476.0, 43496.0]
[398.0, 650.0]
[416, 432]
p02773
u527261492
2,000
1,048,576
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.
['import collections\nn=int(input())\ns=[]\nfor i in range(n):\n S=input()\n s.append(S)\nd=collections.Counter(s)\ne=list(d.items())\ne.sort(key=lambda x:-x[1])\nf=list(d.values())\nf.sort(reverse=True)\ng=list(d.keys())\nnum=1\nfor i in range(1,len(f)):\n if f[i]==f[0]:\n num+=1\n else:\n break\nlst=[]\nfor j in range(num):\n lst.append(g[j])\nlst.sort()\nfor j in range(num):\n print(lst[j])\n \n\n\n', 'import collections\nn=int(input())\ns=[]\nfor i in range(n):\n S=input()\n s.append(S)\nd=collections.Counter(s)\ne=list(d.items())\ne.sort(key=lambda x:-x[1])\nlst=[]\nfor i in range(len(e)):\n if e[i][1]==e[0][1]:\n lst.append(e[i][0])\n else:\n break\nlst.sort()\nfor j in range(len(lst)):\n print(lst[j])\n\n\n']
['Wrong Answer', 'Accepted']
['s051408833', 's988790967']
[50932.0, 47636.0]
[807.0, 821.0]
[389, 305]
p02773
u533328562
2,000
1,048,576
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.
['from collections import defaultdict\nfrom collections import OrderedDict\nN = int(input())\nans = dict()\nfor _ in range(N):\n k = str(input())\n if k in ans:\n ans[k]+=1\n else:\n ans.update({k:1})\neve = defaultdict(list)\nfor key, value in sorted(ans.items()):\n eve[value].append(key)\nl = eve[max(groupedByValue)]\nfor i in l:\n print(i)', 'from collections import defaultdict\nfrom collections import OrderedDict\nN = int(input())\nanswer = dict()\nfor _ in range(N):\n k = str(input())\n if k in ans:\n ans[k]+=1\n else:\n ans.update({k:1})\ngroupedByValue = defaultdict(list)\nfor key, value in sorted(ans.items()):\n groupedByValue[value].append(key)\nl = groupedByValue[max(groupedByValue)]\nfor i in l:\n print(l)', 'from collections import defaultdict\nfrom collections import OrderedDict\nN = int(input())\nans = dict()\nfor _ in range(N):\n k = str(input())\n if k in ans:\n ans[k]+=1\n else:\n ans.update({k:1})\ngroupedByValue = defaultdict(list)\nfor key, value in sorted(ans.items()):\n groupedByValue[value].append(key)\nj = groupedByValue[max(groupedByValue)]\nfor i in j:\n print(i)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s133167059', 's887712590', 's796874270']
[43484.0, 3316.0, 45268.0]
[833.0, 20.0, 1017.0]
[356, 392, 389]
p02773
u536034761
2,000
1,048,576
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.
['from collections import Counter\nN = int(input())\nS = counter([input() for i in range(N)])\nmost = S.most_common()[0][1]\nans = []\nfor name num in S.items:\n if num != most:\n break\n ans.append(name)\nans.sort()\nfor a in ans:\n print(a)', 'from collections import Counter\nN = int(input())\nS = Counter([input() for i in range(N)])\nmost = S.most_common()[0][1]\nans = []\nfor name, num in S.items():\n if num != most:\n continue\n ans.append(name)\nans.sort()\nfor a in ans:\n print(a)']
['Runtime Error', 'Accepted']
['s805313595', 's783368490']
[3064.0, 43472.0]
[17.0, 685.0]
[235, 241]
p02773
u538844871
2,000
1,048,576
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.
["N = input().split(' ')\nS = [input() for i in range(N)]\n\nans = {}\nfor i in S:\n if i in ans:\n ans[i] += 1\n else:\n ans[i] = 1\n\nmax_value = max(ans.value())\nANS = []\nfor key, value in ans.item():\n if ans[key] == max_value:\n ANS.append(key)\n \nfor i in sorted(ANS):\n print(i)", 'N = int(input())\nS = [input() for i in range(N)]\n\nans = {}\nfor i in S:\n if i in ans:\n ans[i] += 1\n else:\n ans[i] = 1\n\nmax_value = max(ans.values())\nANS = []\nfor key, value in ans.items():\n if ans[key] == max_value:\n ANS.append(key)\n \nfor i in sorted(ANS):\n print(i)']
['Runtime Error', 'Accepted']
['s638106584', 's671930491']
[3064.0, 35220.0]
[17.0, 649.0]
[285, 281]
p02773
u540698208
2,000
1,048,576
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.
['from itertools import groupby\n\nn = int(input())\n\nwords = []\n\nfor i in range(n):\n words.append(input())\n\nwords.sort()\n\ncount_w = {}\n\nfor key, value in groupby(words):\n count_w[key] = len(list(value))\n\nfor i in list(count_w.keys):\n if count_w[i] == max(list(count_w.values)):\n print(i)', 'n = int(input())\n\nwords = [input() for _ in range(n)]\n\nd = {}\n\nfor i in range(n):\n if words[i] not in d:\n d[words[i]] = 1\n else:\n d[words[i]] += 1\n\nm = max(d.values())\nANS = []\n\nfor keys in d.keys():\n if d[keys] == m:\n ANS.append(keys)\n\nANS = sorted(ANS)\n\nfor i in ANS:\n print(i)']
['Runtime Error', 'Accepted']
['s968722875', 's564521336']
[35292.0, 35216.0]
[534.0, 644.0]
[299, 312]
p02773
u541921833
2,000
1,048,576
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.
['N = int(input().rstrip())\nd = {}\nfor _ in range(N):\n string = input().rstrip()\n if string in d.keys():\n d[string] += 1\n else:\n d[string] = 1\nd = sorted(d.items(), key=lambda x:x[1], reverse=True)\nprint(d)\nrets = []\nmax = -1\nfor string, val in d:\n if max == -1:\n max = val\n elif max != val:\n break\n rets.append(string)\n\nfor a in rets[::-1]:\n print(a)\n', 'N = int(input().rstrip())\nd = {}\nfor _ in range(N):\n string = input().rstrip()\n if string in d.keys():\n d[string] += 1\n else:\n d[string] = 1\nd = sorted(d.items(), key=lambda x: x[1], reverse=True)\n# print(d)\nrets = []\nmax = -1\nfor string, val in d:\n if max == -1:\n max = val\n elif max != val:\n break\n rets.append(string)\n\nfor a in sorted(rets):\n print(a)\n']
['Wrong Answer', 'Accepted']
['s292210839', 's390741689']
[44064.0, 43228.0]
[709.0, 858.0]
[399, 404]
p02773
u542190960
2,000
1,048,576
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.
['from collections import defaultdict\n\nn = int(input())\ndict = defaultdict(int)\n\nfor i in range(n):\n s = str(input())\n dict[s] += 1\n\nans_list = [k for k,v in dict.items() if v == max(dict.values())]\n\nfor j in range(len(ans_list)):\n print(ans_list[j])', 'from collections import defaultdict\n\nn = int(input())\ndict1 = defaultdict(int)\n\nfor i in range(n):\n s = str(input())\n dict1[s] += 1\n\ndict1 = sorted(dict1.items(), key=lambda x:x[1], reverse=True)\nmax = dict1[0][1]\nans = []\nfor i in range(len(dict1)):\n if dict1[i][1] == max:\n ans.append(dict1[i][0])\n else:\n break\n\nans.sort()\nfor i in ans:\n print(i)']
['Wrong Answer', 'Accepted']
['s919682182', 's054464466']
[32472.0, 43484.0]
[2104.0, 867.0]
[257, 378]
p02773
u542774596
2,000
1,048,576
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.
['import collections\n\nn = int(input())\ns = [input() for i in range(n)]\ncnt = collections.Counter(s)\nlargest= max(list(cnt.values()))\n\nfor k in cnt.keys():\n if cnt[k] == largest:\n print(k)', 'import collections\n\n\nn = int(input())\ns = [input() for i in range(n)]\ncnt = collections.Counter(s)\nlargest= max(list(cnt.values()))\nl = []\n\nfor k in cnt.keys():\n if cnt[k] == largest:\n l.append(k)\n\nl.sort()\nfor ans in l:\n print(ans)']
['Wrong Answer', 'Accepted']
['s371370379', 's386979938']
[38656.0, 38656.0]
[355.0, 450.0]
[189, 237]
p02773
u547167033
2,000
1,048,576
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.
['import Counter\nn=int(input())\ns=[input() for i in range(n)]\nc=Counter(s)\nl=list(c)\nl.sort(key=lambda x:x[1],reverse=True)\na=l[0][1]\ni=0\nwhile i<n and l[i][1]==a:\n print(l[i][0])\n i+=1', 'from collections import Counter\nn=int(input())\ns=[input() for i in range(n)]\nc=Counter(s)\nl=c.most_common()\nl.sort(key=lambda x:x[1],reverse=True)\na=l[0][1]\ni=0\nans=[]\nwhile i<len(l) and l[i][1]==a:\n ans.append(l[i][0])\n i+=1\nans.sort()\nfor j in ans:\n print(j)']
['Runtime Error', 'Accepted']
['s675750656', 's017351608']
[3060.0, 47668.0]
[17.0, 761.0]
[185, 263]
p02773
u547608423
2,000
1,048,576
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.
['import collections as col\nN=int(input())\nS=[]\nanswer=[]\n\nfor _ in range(N):\n S.append(input())\nT=sorted(S)\ns=col.Counter(T)\nvalues, counts = zip(*s.most_common())\n#print(values,counts)\nprint(values[0])\nt=1\n\nfor i in range(N):\n if counts[i]==max(counts):\n answer.append(values[i])\nanswer.sort()\nfor j in answer:\n print(j)\n ', 'N=int(input())\nS=[input() for _ in range(N)]\n\nS_d={}\nA=[]\n\nfor i in range(N):\n if S[i] not in S_d.keys():\n S_d[S[i]]=1\n else:\n S_d[S[i]]+=1\n\nmax_co=max(S_d.values())\n\nfor j in S_d.keys():\n if S_d[j]==max_co:\n A.append(j)\n\nB=sorted(A)\n\nfor k in B:\n print(k)']
['Runtime Error', 'Accepted']
['s537609537', 's084246323']
[61080.0, 35220.0]
[2105.0, 687.0]
[338, 289]
p02773
u550146922
2,000
1,048,576
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.
['n = int(input())\ns = [input() for _ in range(n)]\n\ns_sort = sorted(s)\n\ns_num = [1]*n\n\nfor i in range(1,n):\n if s_sort[i] == s_sort[i-1]:\n s_num[i] += s_num[i-1]\n\nMaxnum = max(s_num)\n\nindex_num = [n for n, v in enumerate(s_num) if v == Maxnum]\n\n[print(s_sort[i]) for i in index_num,]\n', 'n = int(input())\ns = [input() for _ in range(n)]\n\ns_sort = sorted(s)\n\ns_num = [1]*n\n\nfor i in range(1,n):\n if s_sort[i] == s_sort[i-1]:\n s_num[i] += s_num[i-1]\n\nMaxnum = max(s_num)\n\nindex_num = [n for n, v in enumerate(s_num) if v == Maxnum]\n\n[print(s_sort[i]) for i in index_num]\n']
['Runtime Error', 'Accepted']
['s775494325', 's272035725']
[8912.0, 36224.0]
[25.0, 440.0]
[292, 291]
p02773
u550708243
2,000
1,048,576
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.
['N = input()\nS=[]\nfor i in range(int(N)):\n S.append(input())\n\nset_list = set(S)\nstr_ls =[]\nnum_ls = []\nflag = 0\n\nfor i in set_list:\n num_ls.append(S.count(i))\n str_ls.append(i)\n\nfor i in range(len(str_ls)):\n if num_ls[i] == max(num_ls):\n print(str_ls[i])', 'N = input()\nS=[]\nfor i in range(int(N)):\n S.append(input())\n\nls=[]\nfor i in S:\n if i not in ls:\n ls.append(i)\nstr_ls =[]\nnum_ls = []\nflag = 0\n\nfor i in ls:\n num_ls.append(S.count(i))\n str_ls.append(i)\n\nfor i in range(len(str_ls)):\n if num_ls[i] == max(num_ls):\n print(str_ls[i])', 'from collections import defaultdict\nfrom collections import OrderedDict\nN = int(input())\nans = dict()\nfor _ in range(N):\n k = str(input())\n if k in ans:\n ans[k]+=1\n else:\n ans.update({k:1})\ngroupedByValue = defaultdict(list)\nfor key, value in sorted(ans.items()):\n groupedByValue[value].append(key)\nl = groupedByValue[max(groupedByValue)]\nfor i in l:\n print(i)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s318356269', 's558660728', 's931425130']
[29076.0, 17052.0, 45268.0]
[2105.0, 2104.0, 1011.0]
[272, 307, 389]
p02773
u552533086
2,000
1,048,576
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.
['n=int(input())\ndic = {}\nfor i in range(n):\n a = input()\n if a in dic:\n dic[a] += 1\n else:\n dic[a] = 1\nmaxa = max(dic.values())\nans = [x for x, y in dic.items() if y == maxa]\nprint(sorted(ans))', 'n=int(input())\nlist_ = [input() for i in range(n)]\ndic = {}\nfor a in list_:\n if a in dic:\n dic[a] += 1\n else:\n dic[a] = 1\nmaxa = max(dic.values())\nans = [x for x, y in dic.items() if y == maxa]\nprint(sorted(ans))', 'n=int(input())\nlist_ = [input() for i in range(n)]\ndic = {}\nfor a in list_:\n if a in dic:\n dic[a] += 1\n else:\n dic[a] = 1\nmaxa = max(dic.values())\nans = [x for x, y in dic.items() if y == maxa]\nfor A in sorted(ans):\n print(A)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s156993750', 's723302813', 's684622886']
[37468.0, 38924.0, 35220.0]
[561.0, 535.0, 600.0]
[217, 234, 250]
p02773
u553070631
2,000
1,048,576
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.
['\nn=int(input())\ns=[input() for i in range(n)]\n\n\n\n\nl=list(set(s))\n\n\nl.sort()\n\n\na=[]\n\n\nfor i in range(len(l)):\n a.append(s.count(l[i]))\n \n\nr j in range(len(a)):\n while a[j]==max(a):\n print(l[j])\n j+=1\n\n\n', "n=int(input())\ns=[input() for i in range(n)]\ns=sorted(s)\ns.append('')\ns1=s[0]\nans=['']\ntmp=1\nkaisu=0\nfor i in range(1,n+1):\n if s[i]==s1:\n \n tmp+=1\n else:\n if kaisu<tmp:\n \n \n \n ans=['']\n ans.append(s1)\n kaisu=tmp\n elif kaisu==tmp:\n \n ans.append(s1)\n tmp=1\n s1=s[i]\n \nfor i in range(1,len(ans)):\n print(ans[i])"]
['Runtime Error', 'Accepted']
['s316441650', 's251621940']
[2940.0, 20140.0]
[17.0, 639.0]
[596, 680]
p02773
u556069480
2,000
1,048,576
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.
['N=int(inpu())\nans=[]\ndic={}\nfor i in range(N):\n let=input()\n if let in dic.keys:\n dic.update({let:1})\n else:\n dic.update({let:dic[let]+1})\nscore_sorted = sorted(score.items(), key=lambda x:x[1])\na=0\nfor each in score_sorted.keys():\n if score_sorted[each]>=a:\n ans+=each\n a=score_sorted[each]\n else:\n break\nans.sort()\nfor each in ans:\n print(each)', 'dic = {}\nans = []\na = 0\n\nN = int( input() )\nfor i in range( N ):\n let = input()\n if let not in dic:\n dic.update( { let : 1 } )\n else:\n num=dic[ let ]\n dic[ let ] = num + 1\ndic_sorted = sorted(dic.items(), key=lambda x:x[1])\nfor each in dic_sorted.keys():\n if dic_sorted[ each ] >= a:\n ans+=1\n a=dic_sorted[ each ]\n else:\n break\nans.sort()\nfor each in ans:\n print(each)', 'dic = {}\nans = []\na = 0\n\nN = int( input() )\nfor i in range( N ):\n let = input()\n if let not in dic:\n dic.update( { let : 1 } )\n else:\n num=dic[ let ]\n dic[ let ] = num + 1\ndic_sorted = sorted(dic.items(), key=lambda x:x[1],reverse=True)\nfor each in dic_sorted:\n if each[1] >= a:\n ans.append(each[0])\n a=each[1]\n else:\n break\nans.sort()\nfor each in ans:\n print(each)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s282800885', 's458986612', 's478909085']
[3064.0, 43224.0, 45788.0]
[17.0, 477.0, 801.0]
[367, 392, 389]
p02773
u556589653
2,000
1,048,576
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.
['N = int(input())\nk = []\nmaximum = 1\nnow = 1\nans = []\nfor i in range(N):\n S = input()\n k.append(S)\nk.sort()\nfor j in range(len(k)-1):\n if k[j] == k[j+1]:\n now += 1\n if j == len(k)-2:\n if now>maximum:\n maximum = now\n ans.clear()\n ans.append(k[j])\n elif now == maximum:\n ans.append(k[j])\n else:\n break\n else:\n if now>maximum:\n maximum = now\n ans.clear()\n ans.append(k[j])\n elif now == maximum:\n ans.append(k[j])\n else:\n continue\n if j == len(k)-2:\n if now == maximum:\n ans.append(k[j+1])\nfor i in range(len(ans)):\n print(ans[i])', 'import collections\nN = int(input())\nk = []\nfor i in range(N):\n k.append(input())\nc = collections.Counter(k)\nl = list(c.most_common())\nP = l[0][1]\na = []\nfor i in range(len(l)):\n if l[i][1] == P:\n a.append(l[i][0])\n else:\n break\na.sort()\nfor j in range(len(a)):\n print(a[j])']
['Wrong Answer', 'Accepted']
['s288627178', 's647296484']
[20808.0, 47772.0]
[667.0, 774.0]
[771, 283]
p02773
u556610039
2,000
1,048,576
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.
['import collections\n\nn = int(input())\nlist = []\nfor x in range(n):\n s = input()\n list.append(s)\nc = collections.Counter(list)\nmc = c.most_common()\nmax = mc[0][1]\nfor val in mc:\n if max == val[1]: print(val[0])\n else: break\n', 'import collections\n\nn = int(input())\nlist = []\nfor x in range(n):\n s = input()\n list.append(s)\nc = collections.Counter(list)\nmc = c.most_common()\nmax = mc[0][1]\nanslist = []\nfor val in mc:\n if max == val[1]: anslist.append(val[0])\n else: break\nanslist.sort\nfor x in anslist:\n print(x)\n', 'import collections\n\nn = int(input())\nlist = []\nfor x in range(n):\n s = input()\n list.append(s)\nc = collections.Counter(list)\nmc = c.most_common()\nmax = mc[0][1]\nanslist = []\nfor val in mc:\n if max == val[1]: anslist.append(val[0])\n else: break\nanslist.sort()\nfor x in anslist:\n print(x)\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s191589541', 's491497321', 's669751146']
[46868.0, 47056.0, 47676.0]
[548.0, 566.0, 756.0]
[234, 300, 302]
p02773
u557282438
2,000
1,048,576
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.
['N = int(input())\nS = []\nS_dict = {}\nfor i in range(N):\n S.append(input())\nfor i in range(N):\n if(S[i] in S_dict):\n S_dict[S[i]] = S_dict[S[i]]+1\n else:\n S_dict[S[i]] = int(1)\nfor i in range(len(S_dict)):\n if(S_dict[S[i]]== max(S_dict.values())):\n print(S[i])', 'import collections\nN = int(input())\nS = []\n\nres = []\nfor i in range(N):\n S.append(input())\n\nSS = collections.Counter(S)\nfor i in range(len(S_dict)):\n if(SS[S[i]]== max(SS.values())):\n res.append(S[i])\nres.sort()\nfor i in range(len(res)):\n print(res[i])\n ', 'import collections\nN = int(input())\nS = []\n\nres = []\nfor i in range(N):\n S.append(input())\n\nSS = collections.Counter(S)\nm = max(SS.values())\nfor i in SS.keys():\n if(SS[i]== m):\n res.append(i)\nres.sort()\nfor i in range(len(res)):\n print(res[i])']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s103618306', 's514986332', 's149290487']
[35220.0, 35568.0, 35572.0]
[2105.0, 314.0, 689.0]
[291, 273, 259]
p02773
u557642273
2,000
1,048,576
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.
["def check(input_list):\n vote_dict = {}\n \n for a in input_list:\n if(a in vote_dict.keys()):\n vote_dict[a] += 1\n else:\n vote_dict[a] = 1\n \n return [k for k, v in vote_dict.items() if v == max(vote_dict.values())]\n\nif __name__ == '__main__':\n num = int(input())\n input_list = [input() for a in range(num)]\n\n for str in check(input_list):\n print(str)\n", "import collections\n\ndef check(input_list):\n\n vote_dict = collections.Counter(input_list)\n max_value = max(vote_dict.values())\n\n result_list = [k for k, v in vote_dict.items() if v == max_value]\n result_list.sort()\n \n return result_list\n\nif __name__ == '__main__':\n num = int(input())\n input_list = [input() for a in range(num)]\n\n for str in check(input_list):\n print(str)\n "]
['Wrong Answer', 'Accepted']
['s282950267', 's662136680']
[35220.0, 35564.0]
[2105.0, 574.0]
[422, 414]
p02773
u558717347
2,000
1,048,576
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.
['import sys\ninput_first = input()\nN= int(input_first)\n\nwordl = []\ntimesl = []\n\nfor i in range(N):\n S = input()\n wordl.append(S)\n\nmaxnum = 1\ntmp=1\nresultl =[]\nfor i in range(N-1):\n if wordl[i] == wordl[i+1]:\n tmp +=1\n else:\n if maxval == tmp:\n resultl.append(wordl[i])\n elif maxval<tmp:\n resultl = []\n resultl.append(wordl[i])\n maxval = tmp\n else:\n pass\n tmp = 1\n\n\nresultl.sort()\n\nprint(resultl)', 'import sys\ninput_first = input()\nN= int(input_first)\n\nwordl = []\ntimesl = []\n\nfor i in range(N):\n S = input()\n if S in wordl:\n timesl[wordl.index(S)] +=1\n else:\n wordl.append(S)\n timesl.append(1)\n\nmaxval =max(timesl) \nmaxind = [j for j,val in enumerate(timesl) if val == maxval]\n\nprint("--------------------")\nresultl=[]\nfor i in maxind:\n resultl.append(wordl[i])\n\nresultl.sort()\nprint(resultl)\n', 'import sys\ninput_first = input()\nN= int(input_first)\n\nwordl = []\ntimesl = []\n\nfor i in range(N):\n S = input()\n if S in wordl:\n timesl[wordl.index(S)] +=1\n else:\n wordl.append(S)\n timesl.append(1)\n\nmaxval =max(timesl) \nmaxind = [j for j,val in enumerate(timesl) if val == maxval]\n\nfor i in maxind:\n print(wordl[i])\n', 'import sys\ninput_first = input()\nN= int(input_first)\n\nworddic={}\n\nfor i in range(N):\n S = input()\n if S in worddic:\n worddic[S] +=1\n else:\n worddic[S] =1\n\n# result=[keyval[0] for keyval in worddic.items() if keyval[1]==max(worddic.values())]\n\nmaxval = 0\nfor i in worddic.items():\n if i[1] > maxval :\n maxval = i[1]\n result=[]\n result.append(i[0])\n elif i[1] == maxval:\n result.append(i[0])\n else:\n pass\n\nresult.sort()\nfor i in result:\n print(i)']
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s174152592', 's389044629', 's957388165', 's272146070']
[17056.0, 4468.0, 4596.0, 32096.0]
[294.0, 2104.0, 2104.0, 713.0]
[497, 428, 347, 514]
p02773
u559196406
2,000
1,048,576
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.
['import collections\n\nN = int(input())\ns = list(input().split())\n\nc = collections.Counter(s)\nmax_num = list(c.values())[0]\nd = []\nfor key,value in c:\n if value == max_num:\n d.append(key)\n else:\n break\n \nfor i in sorted(d):\n print(i)\n \n\n', 'import collections\n\nN = int(input())\ns = list(map(int, input().split()))\n\nc = collections.Counter(s)\nmax_num = list(c.values())[0]\nd = []\nfor key,value in c:\n if value == max_num:\n d.append(key)\n else:\n break\n \nfor i in sorted(d):\n print(i)\n \n\n', 'import collections\n\nN = int(input())\ns = [input() for i in range(N)]\n\nc = collections.Counter(s)\nmax_num = list(c.values())[0]\nd = []\nfor key,value in c.items():\n if value == max_num:\n d.append(key)\n\nfor i in sorted(d):\n print(i)', 'N = int(input())\ns = [input() for i in range(N)]\n\nn = N\nmax_num = 0\nt = []\nwhile n >= max_num:\n word = s[0]\n\tcount = 0\n for i in s:\n if i == word:\n count += 1\n \n if count > max_num:\n max_num = count\n t = [s[0]]\n elif count == max_num:\n t = t.append(s[0])\n \n s = [i for i in s if i != word]\n n = len(s)\n\nt = sorted(t)\nfor i in range(t):\n print(i)', 'import collections\n\nN = int(input())\ns = list(map(int, input().split()))\n\nc = collections.Counter(s)\nmax_num = list(c.values())[0]\nd = []\nfor key,value in c.items():\n if value == max_num:\n d.append(key)\n else:\n break\n \nfor i in sorted(d):\n print(i)\n \n\n', 'import collections\n\nN = int(input())\ns = [input() for i in range(N)]\n\nc = collections.Counter(s)\nmax_num = list(c.values())[0]\nd = []\nfor key,value in c.items():\n if value == max_num:\n d.append(key)\n else:\n break\n\nfor i in sorted(d):\n print(i)', 'import collections\n\nN = int(input())\ns = [input() for i in range(N)]\n\nc = collections.Counter(s)\nmax_num = list(c.values())[0]\nd = []\nfor key,value in c:\n if value == max_num:\n d.append(key)\n else:\n break\n \nfor i in sorted(d):\n print(i)\n \n\n', 'import collections\n\nN = int(input())\ns = [input() for i in range(N)]\n\nc = collections.Counter(s)\nmax_num = max(c.values())\nd = []\nfor key,value in c.items():\n if value == max_num:\n d.append(key)\n\nfor i in sorted(d):\n print(i)\n']
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s143140791', 's230194449', 's287221306', 's340955390', 's519465012', 's807849706', 's949743807', 's136780610']
[3316.0, 3316.0, 35572.0, 2940.0, 3316.0, 35572.0, 35572.0, 35572.0]
[21.0, 20.0, 616.0, 17.0, 20.0, 609.0, 334.0, 660.0]
[247, 257, 234, 403, 265, 252, 253, 231]
p02773
u561231954
2,000
1,048,576
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.
["n=int(input())\npoll=[input() for i in range(n)]\n\ndic={}\nfor string in poll:\n if string not in dic:\n dic[string]=1\n else:\n dic[string]+=1\n\nmax_k=[k for k, v in dic.items() if v == max(dic.values())]\nprint(*max_k,sep='\\n')", "def main():\n n=int(input())\n poll=[input() for i in range(n)]\n\n dic={}\n for string in poll:\n if string not in dic:\n dic[string]=1\n else:\n dic[string]+=1\n \n x=max(dic.values()) \n max_k=[k for k, v in dic.items() if v==x]\n max_k.sort()\n print(*max_k,sep='\\n')\n \nif __name__=='__main__':\n main()"]
['Wrong Answer', 'Accepted']
['s657451832', 's211770075']
[35216.0, 35596.0]
[2105.0, 556.0]
[228, 319]
p02773
u561859676
2,000
1,048,576
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.
['print()\n\nN = int(input())\n\ndic = {}\n\nfor i in range(N):\n\tkey = input()\n\tif key not in dic:\n\t\tdic[key] = 0\n\telse:\n\t\tdic[key] +=1\n\nmaxnum = max(dic.values())\n\nkeys = list(dic.keys())\nfor key in reversed(keys):\n\tif dic[key] == maxnum:\n\t\tprint(key)\n\n\n', 'N = int(input())\n\ndic = {}\n\nfor i in range(N):\n\tkey = input()\n\tif key not in dic:\n\t\tdic[key] = 1\n\telse:\n\t\tdic[key] +=1\n\nmaxnum = max(dic.values())\n#print(maxnum)\n#print(dic)\n\nkeys = list(dic.keys())\nfor key in sorted(keys):\n\tif dic[key] == maxnum:\n\t\tprint(key)\n\n\n']
['Wrong Answer', 'Accepted']
['s056652485', 's234956119']
[32220.0, 33116.0]
[511.0, 709.0]
[247, 263]
p02773
u561883765
2,000
1,048,576
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.
['import collections\n\nn = int(input())\nst = [input() for i in range(n)]\n\nc = collections.Counter(st)\nc.most_common()\nc_val = list(c.values())\nc_key = list(c.keys())\n\ncounter = 0\nres = []\nif len(c_val) == 1:\n print(c_key[0])\nelse:\n for i in range(len(c_val)):\n if c_val[i] >= counter:\n counter = c_val[i]\n res.append(c_key[i])\n res = list(set(res))\n res.sort()\n \n for i in range(len(res)):\n print(res[i])', 'import collections\n \nn = int(input())\nst = [input() for i in range(n)]\n \nc = collections.Counter(st)\nc.most_common()\nc_val, c_key= zip(*c.most_common()) \nc_key,c_val = list(c_val),list(map(int,c_key))\ncounter = 0\nres = []\nif len(c_val) == 1:\n print(c_key[0])\nelse:\n for i in range(len(c_val)):\n if c_val[i] >= counter:\n counter = c_val[i]\n res.append(c_key[i])\n res = list(set(res))\n res.sort()\n \n for i in range(len(res)):\n print(res[i])\n']
['Wrong Answer', 'Accepted']
['s789904105', 's460120463']
[49396.0, 59632.0]
[812.0, 1085.0]
[423, 461]
p02773
u562550538
2,000
1,048,576
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.
['from collections import Counter\nn=int(input())\na=[input() for _ in range(n)]\nc=Counter(s)\nsort(c.items())\nmax_cnt=max(c.values())\nnames=[name for k,v in c if v==max_cnt]\nprint(names)', "from collections import Counter\nn=int(input())\na=[input() for _ in range(n)]\nc=Counter(a)\nsorted(c.items())\nmax_cnt=max(c.values())\nprint(max_cnt)\nnames=[name for name,v in c.items() if v==max_cnt]\nprint(*names,sep='\\n')", "from collections import Counter\nn=int(input())\na=[input() for _ in range(n)]\nc=Counter(a)\nsorted(c.items())\nmax_cnt=max(c.values())\nnames=[name for name,v in c.items() if v==max_cnt]\nprint(*names,sep='\\n')", 'from collections import Counter\nn=int(input())\na=[input() for _ in range(n)]\nc=Counter(a)\nsorted(c.items())\nmax_cnt=max(c.values())\nprint(max_cnt)\nnames=[name for name,v in c.items() if v==max_cnt]\nprint(names)', "from collections import Counter\nn=int(input())\na=[input() for _ in range(n)]\nc=Counter(a)\nmax_cnt=max(c.values())\nnames=[name for name,v in c.items() if v==max_cnt]\nnames.sort()\nprint(*names,sep='\\n')"]
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s132878248', 's280576715', 's879700004', 's905388813', 's857245023']
[17412.0, 48496.0, 48576.0, 52720.0, 35824.0]
[299.0, 831.0, 752.0, 704.0, 574.0]
[182, 220, 205, 210, 200]
p02773
u572343785
2,000
1,048,576
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.
['import collections\nn = int(input())\ns = [0]*n\nfor i in range(n):\n s[i] = input()\n\nset_s = set(s)\ncnt_s = collections.Counter(s)\nm=0\nfor i in set_s:\n m = max(m,cnt_s[i])\n \nfor i in set_s:\n if cnt_s[i]==m:\n print(i)\n\n', 'import collections\nn = int(input())\ns = [0]*n\nfor i in range(n):\n s[i] = input()\n\nset_s = set(s)\ncnt_s = collections.Counter(s)\n\nm=0\nfor i in set_s:\n m = max(m,cnt_s[i])\nans=[]\nfor i in set_s:\n if cnt_s[i]==m:\n ans.append(i)\nans = sorted(ans)\n\nfor a in ans:\n print(a)\n\n']
['Wrong Answer', 'Accepted']
['s539351730', 's125990118']
[49764.0, 49764.0]
[590.0, 792.0]
[234, 288]
p02773
u572425901
2,000
1,048,576
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.
['import sys\nimport collections\n\nN = int(input())\nS = []\nfor _ in range(N):\n S.append(input()) \nc = collections.Counter(S)\na = c.most_common()\ns = c.most_common()[0][1]\nans = []\nfor i in a:\n if i[1] == s:\n print(i[0])', 'import sys\nimport collections\n\nN = int(input())\nS = []\nfor _ in range(N):\n S.append(input()) \nc = collections.Counter(S)\na = c.most_common()\ns = c.most_common()[0][1]\nans = []\nfor i in a:\n if i[1] == s:\n print(i[0])', 'import sys\nimport collections\n\nN = int(input())\nS = []\nfor _ in range(N):\n S.append(input()) \nc = collections.Counter(S)\na = c.most_common()\ns = c.most_common()[0][1]\nans = []\nfor i in a:\n if i[1] == s:\n print(i[0])\n sys.stdout.flush ', 'import sys\nimport collections\n\nN = int(input())\nS = []\nfor _ in range(N):\n S.append(input()) \nc = collections.Counter(S)\na = c.most_common()\ns = c.most_common()[0][1]\nans = []\nfor i in sorted(a):\n if i[1] == s:\n print(i[0])\n sys.stdout.flush ']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s447918813', 's572488575', 's970824606', 's315720571']
[59376.0, 59376.0, 59492.0, 59368.0]
[649.0, 609.0, 702.0, 863.0]
[228, 228, 254, 262]
p02773
u577725859
2,000
1,048,576
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.
['N = int(input())\nS = []\nfor n in range(N):\n S.append(input())\ndic = {}\n\n\nfor n in range(N):\n if S[n] not in dic:\n dic[S[n]] = 1\n else:\n dic[S[n]] += 1\n\nmax = max(dic.values())\nout = []\n\nfor key,val in dic.items():\n if val == max:\n out.append(val)\nout.sorted()\nfor val in range(len(out)):\n print(val)', 'N = int(input())\nS = []\nfor n in range(N):\n S.append(input())\ndic = {}\n\n\nfor n in range(N):\n if S[n] not in dic:\n dic[S[n]] = 1\n else:\n dic[S[n]] += 1\n\nmax = max(dic.values())\n\nfor key,val in dic.items():\n if val == max:\n print(key)', 'N = int(input())\nS = []\nfor n in range(N):\n S.append(input())\ndic = {}\n\n\nfor n in range(N):\n if S[n] not in dic:\n dic[S[n]] = 1\n else:\n dic[S[n]] += 1\n\nmax = max(dic.values())\nout = []\n\nfor key,val in dic.items():\n if val == max:\n out.append(key)\n\nout.sort()\nfor key in out:\n print(key)']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s489920120', 's883609227', 's695605007']
[35220.0, 35220.0, 35216.0]
[399.0, 477.0, 652.0]
[335, 265, 322]
p02773
u579015878
2,000
1,048,576
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.
['N=int(input())\ns={}\nmaxs=0\nfor i in range(N):\n S=input()\n if S not in s:\n s[S]=0\n else:\n s[S]+=1\n maxs=max(maxs,s[S])\ns2=sorted(s.items(), key=lambda x:x[0])\nans=[]\nfor S in s:\n if s[S]==maxs:\n ans.append(S)\nfor A in ans:\n print(A)', 'N=int(input())\ns={}\nmaxs=0\nfor i in range(N):\n S=input()\n if S not in s:\n s[S]=0\n else:\n s[S]+=1\n maxs=max(maxs,s[S])\ns2=sorted(s.items(), key=lambda x:x[0])\nans=[]\nfor S in s:\n if s[S]==maxs:\n ans.append(S)\nfor A in ans:\n print(A)', 'N=int(input())\ns={}\nmaxs=0\nfor i in range(N):\n S=input()\n if S not in s:\n s[S]=0\n else:\n s[S]+=1\n maxs=max(maxs,s[S])\ns=sorted(s.items(), key=lambda x:x[0])\n\nans= [S for S, i in s if i == maxs]\nfor A in ans:\n print(A)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s096823788', 's842639241', 's805880216']
[46556.0, 46556.0, 44764.0]
[858.0, 762.0, 794.0]
[248, 248, 230]
p02773
u581603131
2,000
1,048,576
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.
['import collections\nN = int(input())\nS = [input() for i in range(N)]\ns = collections.Counter(S)\nss = list(s)\n\ncount = 0 \nmax = 0\nfor i in ss:\n if s[i] > max:\n count = 1\n max = s[i]\n elif s[i] == max:\n count += 1\n\nfor i in range(count):\n\tprint(s.most_common()[i][0])', '#bA\nimport collections\nN = int(input())\nS = [input() for i in range(N)]\ns = collections.Counter(S) \n\nmaximum = max(S.values())\nlist = sorted(key for key,value in s.items() if value==maximum)\n\n\nfor i in list:\n print(i)', 'import collections\nN = int(input())\nS = [input() for i in range(N)]\ns = collections.Counter(S) \n\nmaximum = max(S.values())\nlist = sorted(key for key,value in s.items() if value==maximum))\n\n\nfor i in list:\n print(i)', 'N=int(input())\nS=[input() for i in range(N)]\ndictionary={}\nfor word in S:\n if word in dictionary:\n dictionary[word]+=1\n else:\n dictionary[word]=1\nmaximum=max(dictionary.values())\nfor key,value in sorted(dictionary.items()):\n if value==maximum:\n print(key)']
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s062801173', 's802245339', 's862823107', 's217286608']
[46700.0, 35572.0, 2940.0, 45712.0]
[2106.0, 315.0, 17.0, 803.0]
[337, 355, 352, 285]
p02773
u586662847
2,000
1,048,576
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.
['import collections\n# import math\n\n\ndef resolve():\n N = int(input())\n S = []\n for i in range(N):\n ss = input()\n S.append(ss)\n\n counter = collections.Counter(S)\n _, max_count = counter.most_common()[0]\n\n for key in counter:\n if (counter[key] == max_count):\n print(key)\n\n\nresolve()\n', 'import collections\n# import math\n\n\ndef resolve():\n N = int(input())\n S = []\n for i in range(N):\n ss = input()\n S.append(ss)\n\n counter = collections.Counter(S)\n _, max_count = counter.most_common()[0]\n\n ans = []\n\n for key in counter:\n if (counter[key] == max_count):\n ans.append(key)\n\n ans.sort()\n\n for a in ans:\n print(a)\n\n\nresolve()\n']
['Wrong Answer', 'Accepted']
['s153433029', 's378191077']
[45084.0, 45036.0]
[606.0, 691.0]
[329, 400]
p02773
u589381719
2,000
1,048,576
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.
['import collections\nN=int(input())\nS=[input() for i in range(N)]\n\nc=collections.Counter(S)\nmost=c.most_common()\nm_cnt=most[0][1]\nfor i in most:\n if i[1]==m_cnt:\n print(i[0])\n else:\n break', 'import collections\nN=int(input())\nS=[input() for i in range(N)]\n\nc=collections.Counter(S)\nmost=c.most_common()\nm_cnt=most[0][1]\n\ndicts=[]\n\nfor i in most:\n if i[1]==m_cnt:\n dicts.append(i[0])\n else:\n break\ndicts.sort()\nfor i in dicts:\n print(i)']
['Wrong Answer', 'Accepted']
['s740046066', 's920164372']
[46896.0, 47640.0]
[557.0, 701.0]
[206, 266]
p02773
u590825760
2,000
1,048,576
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.
['n = int(input())\nmozi = list()\nfor i in range(n):\n mozi.append(input())\nmozi.sort()\nli = list()\nfor i in range(n):\n if not mozi[i] in li:\n li.append(mozi[i])\nkazu = list()\nfor i in li:\n kazu.append(mozi.count(i))\nm = [i for i ,x in enumerate(kazu) if x == max(kazu)]\nfor i in m:\n print(li[i],end=" ")', 'from collections import Counter \n\nn = int(input())\nli = list()\nfor _ in range(n):\n li.append(input())\na = Counter(li)\nb = max(a.values())\nm = [x[0] for x in a.items() if x[1] == b]\nm.sort()\nfor i in m:\n print(i)']
['Time Limit Exceeded', 'Accepted']
['s147246979', 's290100000']
[17792.0, 35568.0]
[2105.0, 640.0]
[319, 217]
p02773
u592035627
2,000
1,048,576
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.
['N = int(input())\ns = [input() for i in range(N)]\nfrom collections import Counter\ns1 = sorted(s)\n \nc = collections.Counter(s1)\ns2 = c.most_common()\n \n#print(s2)\na = 0\nfor i in range(len(s2)):\n if s2[0][1] == s2[i][1]:\n a = a + 1\n \nfor i in range(a):\n print(str(s2[i][0]))', 'N = int(input())\ns = [input() for i in range(N)]\nimport collections\ns1 = sorted(s)\n \nc = collections.Counter(s1)\ns2 = c.most_common()\n \ns3 = []\na = 0\nfor i in range(len(s2)):\n if s2[0][1] == s2[i][1]:\n s3.append(s2[i][0])\ns4 = sorted(s3)\nfor i in range(len(s4)):\n print(s4[i])']
['Runtime Error', 'Accepted']
['s683827045', 's597631164']
[19712.0, 50896.0]
[395.0, 893.0]
[283, 289]
p02773
u594862874
2,000
1,048,576
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.
['def mostFrequent(L):\n return max(set(L), key = L.count)\n\nN = input()\nL = []\nfor i in range(0,N):\n L.append(input())\nprint(mostFrequent(L))', 'def mostFrequent(L):\n return max(set(A), key = A.count)\n\nN = input()\nL = []\nfor i in range(0,N):\n L.append(input())\nprint(mostFrequent(L))', 'N = input()\nL = []\nfor i in range(0,N):\n\tL.append(input())\n \ndef mostFrequent(L):\n return max(set(A), key = A.count)\n\nprint(mostFrequent(L))', 'from collections import defaultdict\nfrom collections import OrderedDict\nN = int(input())\nans = dict()\nfor _ in range(N):\n k = str(input())\n if k in ans:\n ans[k]+=1\n else:\n ans.update({k:1})\ngroupedByValue = defaultdict(list)\nfor key, value in sorted(ans.items()):\n groupedByValue[value].append(key)\nl = groupedByValue[max(groupedByValue)]\nfor i in l:\n print(i)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s128600267', 's551197140', 's914812286', 's015573759']
[3060.0, 3064.0, 3060.0, 45268.0]
[17.0, 18.0, 17.0, 1200.0]
[140, 140, 144, 389]
p02773
u595375942
2,000
1,048,576
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.
['from collections import Counter\n\nn=int(input())\nS=[input() for _ in range(n)]\n\nc=Counter(s)\nm=max(c.values())\nans = sorted(k for k,v in c.items() if v == m)\nprint("\\n".join(ans))', 'from collections import Counter\n\nn=int(input())\nS=[input() for _ in range(n)]\n\nc=Counter(S)\nm=max(c.values())\nans = sorted(k for k,v in c.items() if v == m)\nprint("\\n".join(ans))']
['Runtime Error', 'Accepted']
['s226149567', 's618718173']
[17408.0, 35952.0]
[280.0, 585.0]
[178, 178]
p02773
u595952233
2,000
1,048,576
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.
['from collections import Counter\n\nN = int(input())\nss = []\nfor i in range(N):\n ss.append(input())\n\nc = Counter(ss)\n\nmax_count = max(c.values())\nfor k, v in c.items():\n if v == max_count:\n print(k)', 'from collections import Counter\n\nN = int(input())\nss = []\nfor i in range(N):\n ss.append(input())\n\nc = Counter(ss)\n\nmax_count = max(c.values())\n\nout_k = []\nfor k, v in c.items():\n if v == max_count:\n out_k.append(k)\nsort(out_k)\nfor k in out_k:\n print(k)', 'from collections import Counter\n\nN = int(input())\nss = []\nfor i in range(N):\n ss.append(input())\n\nc = Counter(ss)\n\nprint(c)\nmax_count = max(c.values())\nfor k, v in c.items():\n if v == max_count:\n print(k)', 'from collections import Counter\n\nN = int(input())\nss = []\nfor i in range(N):\n ss.append(input())\n\nc = Counter(ss)\n\nmax_count = max(c.values())\n\nout_k = []\nfor k, v in c.items():\n if v == max_count:\n out_k.append(k)\nout_k.sort()\nfor k in out_k:\n print(k)']
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s116161230', 's444041724', 's747475569', 's635084428']
[35564.0, 35576.0, 58684.0, 35572.0]
[461.0, 390.0, 652.0, 648.0]
[200, 258, 209, 259]
p02773
u597455618
2,000
1,048,576
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.
['n = int(input())\ns = [input() for i in range(n)]\ns.sort()\nl = set(s)\nms = len(s) - len(l)\nif ms == 0:\n print("\\n".join(s))\n exit()\n\nans = 0\nans_l = []\nfor i in l:\n sc = s.count(i)\n if sc > ans:\n ans_l = [i]\n ans = sc\n elif sc == ans:\n ans_l.append(i)\n \nprint("\\n".join(ans_l))', 'n = int(input())\ns = [input() for i in range(n)]\ns.sort()\nl = sorted(set(s))\nms = len(s) - len(l)\nif ms == 0:\n print("\\n".join(s))\n exit()\n\nans = 0\nans_l = []\nfor i in l:\n if ms >= -1:\n sc = s.count(i)\n if sc > ans:\n ans_l = [i]\n ans = sc\n ms -= sc\n elif sc == ans:\n ans_l.append(i)\n ms -= sc\n else:\n exit()\n \nprint("\\n".join(ans_l))', 'n = int(input())\ns = [input() for i in range(n)]\ns.sort()\nl = sorted(set(s))\nif len(s) == len(l):\n print("\\n".join(s))\n exit()\nif len(l):\n print("\\n".join(s[0]))\n exit()\n\nans = 0\nans_l = []\nfor i in l:\n sc = s.count(i)\n if sc > ans:\n ans_l = [i]\n ans = sc\n elif sc == ans:\n ans_l.append(i)\n \nprint("\\n".join(ans_l))', 'from collections import Counter\n\nn = int(input())\nS = [input() for i in range(n)]\n\ns = Counter(S)\nprint(s)\nmax_cnt = s.most_common()[0][1]\nnames = [name for name, cnt in s.items() if cnt == max_cnt]\nnames.sort()\n\nprint("\\n".join(names))', 'n = int(input())\ns = [input() for i in range(n)]\ns.sort(reverse=True)\nl = set(s)\nms = len(s) - len(l)\nif len(l) == 1:\n print(s[0])\n exit()\nelif len(l) == n:\n s.sort()\n print("\\n".join(s))\n exit()\n\nans = 0\nans_l = []\nfor i in l:\n sc = s.count(i)\n if sc > ans:\n ans_l = [i]\n ans = sc\n elif sc == ans:\n ans_l.append(i)\n \nprint("\\n".join(ans_l))', 'from collections import Counter\n\nn = int(input())\nS = [input() for i in range(n)]\n\ns = Counter(S)\nmax_cnt = s.most_common()[0][1]\nnames = [name for name, cnt in s.items() if cnt == max_cnt]\nnames.sort()\n\nprint("\\n".join(names))']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s100662638', 's134108662', 's326053932', 's755419782', 's785109049', 's587225232']
[30016.0, 29636.0, 29636.0, 58676.0, 30008.0, 45168.0]
[2105.0, 2105.0, 657.0, 719.0, 2104.0, 566.0]
[317, 405, 362, 236, 391, 227]
p02773
u598924163
2,000
1,048,576
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.
["from collections import Counter\nn = int(input())\n#li = ['apple', 'orange', 'apple', 'banana', 'grape','orange']\nli = []\nfor i in range(n):\n li.append(input())\n\n#print(li)\n\ndic = Counter(li)\n#print(dic.most_common())\n#print(max(dic.values()))\nmax = max(dic.values())\n\nfor k,v in dic.items():\n if(v == max): \n print(k)\n\n", "from collections import Counter\nn = int(input())\n#li = ['apple', 'orange', 'apple', 'banana', 'grape','orange']\nli = []\nfor i in range(n):\n li.append(input())\n\n#print(li)\n\ndic = Counter(li)\n#print(dic.most_common())\n#print(max(dic.values()))\nmax = max(dic.values())\n\nlist=[]\n\nfor k,v in dic.items():\n if(v == max): \n list.append(k)\n\n\nlist = sorted(list)\n\n#print(list)\n\nfor i in range(len(list)):\n print(list[i])\n\n"]
['Wrong Answer', 'Accepted']
['s316549668', 's790226195']
[35564.0, 35572.0]
[465.0, 734.0]
[455, 553]
p02773
u601321817
2,000
1,048,576
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.
['N = int(input())\nwords = []\nfor _ in range(N):\n words.append(input())\ncount_table = {}\nfor w in words:\n if w in count_table:\n count_table[w] += 1\n else:\n count_table[w] = 0\nbest_count = 0\nfor w in count_table:\n if best_count < count_table[w]:\n best_count = count_table[w]\n best_words = [w]\n elif best_count == count_table[w]:\n best_words.append(w)\nfor w in sorted(best_words):\n print(w)', 'N = int(input())\nwords = []\nfor _ in range(N):\n words.append(input())\ncount_table = {}\nfor w in words:\n if w in count_table:\n count_table[w] += 1\n else:\n count_table[w] = 0\nbest_count = 0\nbest_words = []\nfor w in count_table:\n if best_count < count_table[w]:\n best_count = count_table[w]\n best_words = [w]\n elif best_count == count_table[w]:\n best_words.append(w)\nfor w in sorted(best_words):\n print(w)']
['Runtime Error', 'Accepted']
['s586605899', 's132592481']
[35220.0, 35216.0]
[349.0, 669.0]
[439, 455]
p02773
u602500004
2,000
1,048,576
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.
['import collections\n\nN = int(input())\n\nS = []\nfor _ in range(N):\n S.append(input())\n\nc = collections.Counter(S)\nc1 = c.most_common()\n\n# print(c1[0][0])\n\ntmp = []\nfor i in range(len(c1)):\n tmp.append(c1[i][0])\n print(sorted(tmp))\n if (c1[0][1] > c1[i][1]):\n break\n\nans = sorted(tmp)\nfor i in range(len(ans)):\n print(ans[i])', "import sys \nfrom collections import Counter\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\nN = int(readline())\nl = read().decode().split()\nc = Counter(l)\n\nmax = c.most_common()[0][1]\nans = [i[0] for i in c.items() if i[1] >= max]\n\nprint('\\n'.join(sorted(ans)))"]
['Runtime Error', 'Accepted']
['s342616717', 's217212757']
[178404.0, 50064.0]
[2400.0, 217.0]
[343, 320]
p02773
u602677143
2,000
1,048,576
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.
['import collections\nn = int(input())\nls = [input() for i in range(n)] \nc = collections.Counter(ls)\ncount = c.most_common()[0][1]\nans = []\nif c.most_common()[0][1] == 1:\n ls.sort()\n for i in ls:\n print(i)\nelse:\n c.sort()\n for i in range(len(c)):\n p = c.most_common()\n if p[i][1] == count:\n print(p[i][0])\n else:\n break ', 'import collections\nn = int(input())\nls = [input() for i in range(n)] \nc = collections.Counter(ls)\ncount = c.most_common()[0][1]\nans = []\nif c.most_common()[0][1] == 1:\n ls.sort()\n for i in ls:\n print(i)\nelse:\n for i in range(len(c)):\n p = c.most_common()\n if p[i][1] == count:\n ans.append(p[i][0])\n else:\n break \n ans = sorted(ans\n for i in ans:\n print(i)', 'import collections\n\nn = int(input())\nls = [input() for i in range(n)] \nc = collections.Counter(ls)\n\ncount = c.most_common()[0][1]\nans = []\np = c.most_common()\nfor i in range(len(c)):\n if p[i][1] == count:\n ans.append(p[i][0])\n else:\n break \nans = sorted(ans)\nfor i in ans:\n print(i)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s211901850', 's500098470', 's668439281']
[45044.0, 3064.0, 49172.0]
[697.0, 17.0, 769.0]
[384, 430, 310]
p02773
u602773379
2,000
1,048,576
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.
['import math\nfrom functools import reduce\nimport itertools\n\ndef input1():\n\treturn int(input())\n\n\ndef input2():\n\treturn map(int,input().split())\n\n\ndef input_array():\n\treturn list(map(int,input().split()))\n\n\n\n\n\nN=input1()\nS=[]\nfor _ in range(N):\n\tS.append(str(input()))\n\ndic={}\nresults=[]\nfor s in S:\n\tif s not in dic:\n\t\tdic[s]=1\n\telse:\n\t\tdic[s]+=1\nans=10000010010\n\n\nscore_sorted = sorted(dic.items(), key=lambda x:x[1])\nmax_count=max(dic.values())\nfor x in score_sorted:\n\tif x[1]==max_count:\n\t\tprint(x[0])\n\n\n', 'import math\nfrom functools import reduce\nimport itertools\n\ndef input1():\n\treturn int(input())\n\n\ndef input2():\n\treturn map(int,input().split())\n\n\ndef input_array():\n\treturn list(map(int,input().split()))\n\n\n\n\n\nN=input1()\nS=[]\nfor _ in range(N):\n\tS.append(str(input()))\n\ndic={}\nresults=[]\nfor s in S:\n\tif s not in dic:\n\t\tdic[s]=1\n\telse:\n\t\tdic[s]+=1\nans=10000010010\n\n\nscore_sorted = sorted(dic.items(), key=lambda x:x[1])\nprint(score_sorted)\nmax_count=max(dic.values())\nfor x in score_sorted:\n\tif x[1]==max_count:\n\t\tresults.append(x[0])\nresults.sort()\nfor i in results:\n\tprint(i)\n\n\n\n\n\n\n', 'import math\nfrom functools import reduce\nimport itertools\n\ndef input1():\n\treturn int(input())\n\n\ndef input2():\n\treturn map(int,input().split())\n\n\ndef input_array():\n\treturn list(map(int,input().split()))\n\n\n\n\n\nN=input1()\nS=[]\nfor _ in range(N):\n\tS.append(str(input()))\n\ndic={}\nresults=[]\nfor s in S:\n\tif s not in dic:\n\t\tdic[s]=1\n\telse:\n\t\tdic[s]+=1\nans=-1\n\n# \tif ans==0:\n# \t\tans=v\n# \telif ans==v:\n\nscore_sorted = sorted(dic.items(), key=lambda x:x[1], reverse=True)\n\nfor x in score_sorted:\n\tif x[1]>=ans:\n\t\tprint(x[0])\n\t\tans=x[1]\n\telse:\n\t\tbreak\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n', 'import math\nfrom functools import reduce\nimport itertools\n\ndef input1():\n\treturn int(input())\n\n\ndef input2():\n\treturn map(int,input().split())\n\n\ndef input_array():\n\treturn list(map(int,input().split()))\n\n\n\n\n\nN=input1()\nS=[]\nfor _ in range(N):\n\tS.append(str(input()))\n\ndic={}\nresults=[]\nfor s in S:\n\tif s not in dic:\n\t\tdic[s]=1\n\telse:\n\t\tdic[s]+=1\nans=10000010010\n\n\nscore_sorted = sorted(dic.items(), key=lambda x:x[1])\n\nmax_count=max(dic.values())\nfor x in score_sorted:\n\tif x[1]==max_count:\n\t\tresults.append(x[0])\nresults.sort()\nfor i in results:\n\tprint(i)\n\n\n\n\n\n\n']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s535771669', 's537966181', 's732081188', 's303198343']
[47112.0, 55360.0, 47112.0, 47904.0]
[642.0, 850.0, 611.0, 757.0]
[589, 665, 667, 646]
p02773
u603324902
2,000
1,048,576
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.
['n = int(input())\ns = sorted([str(input()) for _ in range(n)])\n\nS = set(s)\nc_m = int(0)\nl = []\nans = []\n\nfor i in range(len(S)):\n a = S.pop()\n c_i = int(s.count(a))\n if c_i >= c_m:\n c_m = c_i\n l.append([c_m, a])\n continue\n\nl.sort(reverse = True)\nfor i in range(len(l)):\n if l[0][0] == l[i][0]:\n ans = l[i][1]\n print(ans)\n', 'n = int(input())\nd = dict()\nfor _ in range(n):\n x = str(input())\n if x in d:\n d[x] += 1\n continue\n else:\n d[x] = 0\n\nd_sort = sorted(d.items(), key=lambda d:d[1], reverse = True)\nd_max = d_sort[0][1]\n\nans = []\nfor i in d_sort:\n if d_max == i[1]:\n ans.append(i[0])\n else:\n break\n\nans.sort()\nfor a in ans:\n print(a)\n']
['Wrong Answer', 'Accepted']
['s974112729', 's835246683']
[29608.0, 45788.0]
[2105.0, 746.0]
[367, 366]
p02773
u604055101
2,000
1,048,576
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.
['import collections\n\nn = int(input())\ns_list = []\nfor _ in range(n):\n s_list.append(input())\ns_data = collections.Counter(s_list).most_common()\ns_count = s_data[0][1]\ns_index = 1\nfor s in s_data:\n if s[1] == s_count:\n s_index += 1\n else:\n break\n \n\nfor i in range(s_index):\n print(s_data[i][0])', 'import collections\n\nn = int(input())\ns_list = []\nfor _ in range(n):\n s_list.append(input())\ns_data = list(collections.Counter(s_list).most_common())\ns_count = int(s_data[0][1])\ns_index = 0\nfor s in s_data:\n if int(s[1]) == s_count:\n s_index += 1\n else:\n break\noutput = []\nfor i in range(s_index):\n output.append(s_data[i][0])\noutput.sort()\nfor s in output:\n print(s)\n']
['Runtime Error', 'Accepted']
['s783992818', 's621751432']
[45032.0, 45036.0]
[579.0, 777.0]
[321, 396]
p02773
u606523772
2,000
1,048,576
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.
['N = int(input())\nS_list = []\nfor i in range(N):\n x = input()\n S_list.append(x)\nanother_list = [S_list[0]]\ncnt_list = [1]\nfor i in range(1, N):\n for j in range(len(another_list)):\n if another_list[j] == S_list[i]:\n cnt_list[j] += 1\n break\n if j == len(another_list)-1:\n another_list.append(S_list[i])\n cnt_list.append(1)\nmax_v = max(cnt_list)\ncnt = []\nfor i in range(len(cnt_list)):\n if max_v == cnt_list[i]:\n cnt.append(i)\ncnt1 = []\nfor i in range(len(cnt)):\n cnt1.append(another_list[cnt[i]])\nif len(cnt1) > 2:\n for _ in range(len(cnt1)-1):\n for i in range(len(cnt1)-1):\n tmp = "s"\n if ord(cnt1[i][0]) > ord(cnt1[i+1][0]):\n tmp = cnt1[i+1][0] \n cnt1[i+1][0] = cnt1[i][0]\n cnt1[i][0] = tmp\nprint(cnt1)\n', 'N = int(input())\nS_list = []\nfor i in range(N):\n x = input()\n S_list.append(x)\nanother_list = [S_list[0]]\ncnt_list = [1]\nfor i in range(1, N):\n for j in range(len(another_list)):\n if another_list[j] == S_list[i]:\n cnt_list[j] += 1\n break\n if j == len(another_list)-1:\n another_list.append(S_list[i])\n cnt_list.append(1)\nmax_v = max(cnt_list)\ncnt = []\nfor i in range(len(cnt_list)):\n if max_v == cnt_list[i]:\n cnt.append(i)\ncnt1 = []\nfor i in range(len(cnt)):\n cnt1.append(another_list[cnt[i]])\nfor i in range(len(cnt1)):\n print("{}".format(cnt1[i]))', 'N = int(input())\nS_dic = {}\nfor i in range(N):\n S = input()\n if S in S_dic:\n S_dic[S] += 1\n else:\n S_dic[S] = 1\nmax_v = max(S_dic.values())\nans_list = [key for key, val in S_dic.items() if val == max_v]\nans_list.sort()\nprint("\\n".join(ans_list))']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s262539009', 's650835640', 's672489719']
[19124.0, 17056.0, 34140.0]
[2104.0, 2105.0, 528.0]
[847, 620, 268]
p02773
u607563136
2,000
1,048,576
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.
['from collections import Counter\n\nn = int(input())\n\ns = [input() for _ in range(n)]\n\nc = Counter(s)\n\ncsort = sorted(c.items(), key=lambda x:x[1],reverse=True)\n\nmaxc = csort[0][1]\n\nfor s,v in csort:\n if v == maxc:\n print(s)', 'from collections import Counter\n\nn = int(input())\n\ns = [input() for _ in range(n)]\n\nc = Counter(s)\n\ncsort = sorted(c.items(), key=lambda x:x[1],reverse=True)\n\nmaxc = csort[0][1]\nans = []\nfor s,v in csort:\n if v == maxc:\n ans.append(s)\n \nanssort = sorted(ans)\n\nfor s in anssort:\n print(s)']
['Wrong Answer', 'Accepted']
['s887752438', 's415350015']
[49388.0, 50108.0]
[366.0, 488.0]
[231, 307]
p02773
u608053762
2,000
1,048,576
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.
['import numpy as np\n\nn = int(input())\ns_list = [input() for i in range(n)]\n\nnew_dict = {}\nfor s in s_list:\n if s not in new_dict.keys():\n new_dict[s] = 1\n else:\n new_dict[s] += 1\n \nvalues = []\nkeys = [] \nfor key in new_dict.keys():\n values.append(new_dict[key])\n keys.append(key)\n \nvalues = np.array(values)\nkeys = np.array(keys)\n\nmax_index = values == np.max(values)\nkeys = keys[max_index].tolist()\n\nfor key in keys:\n print(key)', 'import numpy as np\n\nn = int(input())\ns_list = [input() for i in range(n)]\n\nnew_dict = {}\nfor s in s_list:\n if s not in new_dict.keys():\n new_dict[s] = 1\n else:\n new_dict[s] += 1\n \nvalues = []\nkeys = [] \nfor key in new_dict.keys():\n values.append(new_dict[key])\n keys.append(key)\n \nvalues = np.array(values)\nkeys = np.array(keys)\n\nmax_index = values == np.max(values)\nkeys = keys[max_index].tolist()\nkeys = sorted(keys)\n\nfor key in keys:\n print(key)']
['Wrong Answer', 'Accepted']
['s978180585', 's111190087']
[79388.0, 79364.0]
[716.0, 880.0]
[466, 486]
p02773
u608579392
2,000
1,048,576
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.
['N = int(input())\nword_count = {}\nfor i in range(N):\n word = input()\n if word not in word_count:\n word_count[word] = 1\n else:\n word_count[word] += 1\n\ncounts = [val for (key, val) in word_count.items()]\nmax_count = max(counts)\nwords = [key for (key, val) in word_count.items() if val == max_count]\nfor word in words:\n print(word)\n', 'N = int(input())\nword_count = {}\nfor i in range(N):\n word = input()\n if word not in word_count:\n word_count[word] = 1\n else:\n word_count[word] += 1\n\ncounts = [val for (key, val) in word_count.items()]\nmax_count = max(counts)\nwords = sorted([key for (key, val) in word_count.items() if val == max_count])\nfor word in words:\n print(word)\n']
['Wrong Answer', 'Accepted']
['s005598472', 's355738339']
[32476.0, 34652.0]
[476.0, 637.0]
[354, 362]
p02773
u609814378
2,000
1,048,576
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.
['import collections\nimport sys\nN = int(input())\nS = [input() for _ in range(N)]\n\n\n\nc = collections.Counter(S)\nans = []\n\nfor i in range(len(c.most_common())):\n if i == 0:\n print(c.most_common()[0][0])\n \n if i != 0:\n if (c.most_common()[i-1][1]) == (c.most_common()[i][1]):\n ans.append(((c.most_common()[i][0])))\n else:\n break\n\nans2 = sorted(ans)\nfor i in ans2:\n print(i)', 'import collections\nimport sys\nN = int(input())\nS = [input() for _ in range(N)]\n\n\n\nc = collections.Counter(S)\n\n\nfor i in range(len(c.most_common())):\n if i == 0:\n print(c.most_common()[0][0])\n \n if i != 0:\n if (c.most_common()[i-1][1]) == (c.most_common()[i][1]):\n print((c.most_common()[i][0]))\n else:\n sys.exit()', 'import collections\nimport sys\nN = int(input())\nS = [input() for _ in range(N)]\n\n\n\nc = collections.Counter(S)\nans = []\n\nfor i in range(len(c.most_common())):\n if i == 0:\n print(c.most_common()[0][0])\n \n if i != 0:\n if (c.most_common()[i-1][1]) == (c.most_common()[i][1]):\n ans.append(((c.most_common()[i][0])))\n else:\n break\nans.sort()\n\nfor i in ans:\n print(i)', 'import collections\nimport sys\nN = int(input())\nS = [input() for _ in range(N)]\n\nc = collections.Counter(S)\nans = []\nli=c.most_common()\nfor i in range(len(li)):\n if i == 0:\n ans.append(((li[0][0])))\n \n if i != 0:\n if (li[i-1][1]) == (li[i][1]):\n \n ans.append(((li[i][0])))\n else:\n break\n\nans.sort()\n\nfor i in ans:\n print(i)\n']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s695636445', 's895337444', 's930712768', 's938725818']
[45228.0, 45044.0, 45044.0, 47636.0]
[2106.0, 2109.0, 2106.0, 737.0]
[423, 365, 414, 389]