n = int(input())
a_w = 0
a_e = 0
a_l = 0
a_dic = {"B": 0, "C": 0, "J": 0}
b_dic = {"B": 0, "C": 0, "J": 0}
for i in range(n):
res = input()
if res == "B B" or res == "C C" or res == "J J":
a_e += 1
elif res == "B C" or res == "C J" or res == "J B":
a_w += 1
a_dic[res[0]] += 1
else:
a_l += 1
b_dic[res[0]] += 1
a_w = str(a_w)
a_e = str(a_e)
a_l = str(a_l)
print("{} {} {}".format(a_w, a_e, a_l))
print("{} {} {}".format(a_l, a_e, a_w))
for i in a_dic.keys():
if a_dic[i] == max(a_dic.values()):
a_max = i
break
for i in b_dic.keys():
if b_dic[i] == max(b_dic.values()):
b_max = i
break
print("{} {}".format(a_max,b_max))
PAT basic 1018 python
最新推荐文章于 2024-11-07 00:26:41 发布