c = 0
while True:
    try:
        if c % 2 == 0:
            A = [int(x) for x in input().split()]
        else:
            B = [int(x) for x in input().split()]
            hit = blow = 0
            for i in range(len(B)):
                if A[i] == B[i]:
                    hit += 1
                else:
                    if B[i] in A:
                        blow += 1
            print(hit,blow)
                
        c += 1    
    except EOFError:
        break

            
        
        
