Go: package main

import (
	"bufio"
	"os"
	"strings"
	"strconv"
	"fmt"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	a := make([]int, 4)
	b := make([]int ,4)
	for scanner.Scan() {
		inputa := strings.Split(scanner.Text(), " ")
		for i := range a {
			a[i], _ = strconv.Atoi(inputa[i])
		}
		scanner.Scan()
		inputb := strings.Split(scanner.Text(), " ")
		for i := range b {
			b[i], _ = strconv.Atoi(inputb[i])
		}
		hit := 0
		blow := 0
		if a[0] == b[0] {
			hit++
		}
		if a[1] == b[1] {
			hit++
		}
		if a[2] == b[2] {
			hit++
		}
		if a[3] == b[3] {
			hit++
		}
		if a[0] == b[1] {
			blow++
		}
		if a[1] == b[2] {
			blow++
		}
		if a[2] == b[3] {
			blow++
		}
		if a[1] == b[0] {
			blow++
		}
		if a[2] == b[1] {
			blow++
		}
		if a[2] == b[0] {
			blow++
		}
		if a[3] == b[2] {
			blow++
		}
		if a[3] == b[1] {
			blow++
		}
		if a[3] == b[0] {
			blow++
		}
		if a[0] == b[2] {
			blow++
		}
		if a[1] == b[3] {
			blow++
		}
		if a[0] == b[3] {
			blow++
		}
		fmt.Printf("%d %d\n", hit, blow)
	}
}

Python: while True:
    try:
        a=[int(i) for i in input().split()]
        b=[int(i) for i in input().split()]
    except:break
    hit=sum([1 for i in range(4) if a[i]==b[i]])
    blow=8-len(set(a)|set(b))-hit
    print("{0} {1}".format(hit,blow))

Python: while 1:
    try:
        a = list(map(int, input().split()))
        b = list(map(int, input().split()))
    
        hit = 0
        blow = 0

        for i in range(4):
            if a[i] == b[i]:
                hit += 1
            for j in range(4):
                if a[i] == b[j]:
                    blow += 1
        blow -= hit
        print(hit, blow)
        
    except EOFError:
        break

Python: import sys
lines = [list(map(int, line.split())) for line in sys.stdin]
for i in range(0, len(lines), 2):
    a = lines[i]
    b = lines[i + 1]
    hit = sum(1 for i in range(len(a)) if a[i] == b[i])
    blow = sum(1 for bi in b if bi in a) - hit
    print(hit, blow)

Python: try:
    while True:
        L=0
        M=0
        
        A=list(map(int,input().split()))
        B=list(map(int,input().split()))
        
        for i in range(4):
            if A[i]==B[i]:
                L+=1
            
            C=A.count(B[i])
            if C>=1:
                M+=1
                
        print(L,M-L)
        
except EOFError:
    pass

Python: while True:
    try:
        A = list(map(int, input().split()))
        B = list(map(int, input().split()))
    except EOFError:
        break
    hit = sum(1 for i in range(4) if A[i] == B[i])
    blow = sum(1 for i in range(4) if A[i] in B) - hit
    print(hit, blow)

Python: import sys

if __name__ == '__main__':
    data = []
    for line in sys.stdin:
        data.append([int(x) for x in line.strip().split(' ')])
        if len(data) == 2:
            choice_a = data[0]
            choice_b = data[1]
            data = []

            #print(choice_a)
            #print(choice_b)

            # hit&blow?????????
            hit = 0
            blow = 0
#            for i, d in enumerate(choice_a):
#                if d in choice_b:
#                    if choice_a[i] == choice_b[i]:
#                        hit += 1
#                    else:
#                        blow += 1


            for i, d in enumerate(choice_a):
                if d in choice_b:
                    if d == choice_b[i]:
                        hit += 1
                    else:
                        blow += 1

            # ???????????¨???
            print('{0} {1}'.format(hit, blow))

Python: import sys
readline = sys.stdin.readline
write = sys.stdout.write
def solve():
    *A, = map(int, readline().split())
    *B, = map(int, readline().split())
    v1 = v2 = 0
    for i in range(4):
        if A[i] == B[i]:
            v1 += 1
        for j in range(4):
            if i != j and A[i] == B[j]:
                v2 += 1
    write("%d %d\n" % (v1, v2))
try:
    while 1:
        solve()
except:
    ...

Python: import sys
ans = []
for line in sys.stdin:
    aa = list(map(int,input().split()))
    bb = list(map(int,input().split()))
    hit = 0
    blow = 0
    for one in range(len(aa)):
        if aa[one] == bb[one]:
            hit += 1
            
    for one_a in range(len(aa)):
        ai = aa[one_a]
        for one_b in range(len(bb)):
            bi = bb[one_b]
            if ai== bi and one_a != one_b:
                blow += 1
    one_list = [hit,blow]
    ans.append(one_list)

for i in range(len(ans)):
    print(str(ans[i][0]) + ' ' + str(ans[i][1]))

Python: while True:
    try:
        a = list(map(int, input().split()))
        b = list(map(int, input().split()))
        hit  = 0
        blow = 0
        for i in range(4):
            if a[i] == b[i]:
                hit += 1
            elif a[i] in b:
                blow += 1
        print(hit, blow)
    except:
        break

Python: import sys
ans = []
for line in sys.stdin:
    aa = list(map(int,input().split()))
    bb = list(map(int,input().split()))
    hit = 0
    blow = 0
    for one in range(len(aa)):
        if aa[i] == bb[i]:
            hit += 1
            
    for one_a in range(len(aa)):
        ai = aa[one_a]
        for one_b in range(len(bb)):
            bi = bb[one_b]
            if ai== bi and one_a != one_b:
                blow += 1
    one_list = [hit,blow]
    ans.append(one_list)

for i in range(len(ans)):
    print(str(ans[i][0]) + ' ' + str(ans[i][1]))

Python: import sys
Lines = sys.stdin.readlines()

for i in range(0, len(Lines), 2):
    Anumbers = list(map(int, Lines[i].split()))
    Bnumbers = list(map(int, Lines[i+1].split()))
    Hit = 0    
    for j in range(len(Anumbers)):
        Hit += 1 if (Anumbers[j] == Bnumbers[j]) else 0
    Blow = len(set(Anumbers) & set(Bnumbers)) - Hit
    print(Hit, Blow)

Python: import sys
ans = []
for line in sys.stdin:
    aa = list(map(int,line.split()))
    bb = list(map(int,line.split()))
    hit = 0
    blow = 0
    for one_a in range(len(aa)):
        if aa[one_a] == bb[one_a]:
            hit += 1
        if aa[one_a] in bb:
            blow += 1
    blow = blow - hit
    one_list = [hit,blow]
    ans.append(one_list)

for i in range(len(ans)):
    print(str(ans[i][0]) + ' ' + str(ans[i][1]))

Python: while(1):
    hit = 0
    blow = 0
    a = input().split(' ')
    b = input().split(' ')
    for a_, b_ in zip(a, b):
        if a_ == b_:
            hit += 1
        elif a_ in b:
            blow += 1
    print(hit, blow)

Python: while 1:
    try:
        a = list(map(int,input().split()))
        b = list(map(int,input().split()))
        hit = 0
        blow = 0
        for i in range(4):
            if a[i] == b[i]:
                hit += 1
            elif b[i] in a:
                blow += 1
        print(hit,blow) 
    except:
        break

Python: while True:
    try:
        A = list(map(int, input().split()));
    except EOFError:
        break;
    B = list(map(int, input().split()));

    h = 0;
    b = 0;
    for i in range(0,4):
        if A[i] == B[i]:
            h += 1;
        else:
            for j in range(0,4):
                if A[j] == B[i]:
                    b += 1;
    print(h,b);

Python: while 1:
    try:
        a = list(map(int,input().split()))
        b = list(map(int,input().split()))
        hit = 0
        blow = 0
        for i in range(4):
            if a[i] == b[i]:
                hit += 1
            elif b[i] in a:
                blow += 1
        print(hit,blow) 
    except:
        break

Python: import sys

state = True
for s in sys.stdin:
    if state:
        state = not state
        a = list(map(int, s.split()))
    else:
        state = not state
        b = list(map(int, s.split()))
        hit = sum(a[i] == b[i] for i in range(4))
        blow = sum(b[i] in a for i in range(4)) - hit
        print(hit, blow)