while True:
    a=map(int,raw_input().split())
    if not a:break
    b=map(int,raw_input().split())
    hit,blow=0,0
    for i in range(4):
        if a[i]==b[i]:hit+=1
        if a[i] in b :blow+=1
    print hit,blow-hit