int input INF float inf maxx INF maxy INF maxz INF countx county count

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
n = int(input())
INF = float('inf')
maxx=INF
maxy=INF
maxz=INF
countx=0
county=0
countz=0
for i in range(n):
a,b = map(int,input().split(' ')[2:])
if a==15 and b<maxx:
maxx=b
countx=1
elif a==15 and b==maxx: countx+=1
if a==20 and b<maxy:
maxy=b
county=1
elif a==20 and b==maxy: county+=1
if a==25 and b<maxz:
maxz=b
countz=1
elif a==25 and b==maxz: countz+=1
print(countx,county,countz)