n=int(eval(input()))

l=list(map(int,input().split()))

m=c=0

for i in l:

  if m<=i:

    m=i

    c+=1

print(c)
_,*l=list(map(int,open(0).read().split()))

m=c=0

for i in l:

  if m<=i: m=i; c+=1

print(c)
n = int(eval(input()))
l = list(map(int, input().split()))
m = c = 0
for i in l:
    if m <= i:
        m = i
        c += 1
print(c)

_, *l = list(map(int, open(0).read().split()))
m = c = 0
for i in l:
    if m <= i:
        m = i
        c += 1
print(c)

-n = int(eval(input())) -l = list(map(int, input().split())) +_, *l = list(map(int, open(0).read().split()))