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: import sys
inputs = []
for line in sys.stdin:
    inputs.append(line)
n = len(inputs)
for _ in range(n // 2):
    for line in sys.stdin:
        a=list(map(int, sys.stdin[_ * 2].split()))
        b=list(map(int, sys.stdin[_ * 2 + 1].split()))
        hit=0
        blow=0
        for i in range(4):
            if b[i] == a[i]:
                hit += 1
            elif b[i] in a:
                blow += 1
        print(hit, blow)

Python: 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

Python: while True:
	try:
		A=[int(i) for i in input().split()]
		B=[int(i) for i in input().split()]
		#Hit
		hit=0
		for i in range(len(A)):
			if A[i]==B[i]:
				hit+=1
		#Blow
		blow=0
		for i in range(len(A)):
			for j in range(len(A)):
				if i!=j:
					if A[i]==B[j]:
						blow+=1

		print(hit,blow)



	except EOFError:
		break

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

Python: # -*- coding: utf-8 -*-


def main(a, b):
    hit = 0
    blow = 0

    for a_e, b_e in zip(a, b):
        if a_e == b_e:
            hit += 1
        elif a_e in b:
            blow += 1

    print(hit, blow, sep=' ')

while True:
    try:
        a = [int(e) for e in input().split()]
        b = [int(e) for e in input().split()]
    except:
        break

    main(a, b)

Python: while 1:
   try:
       h = 0
       b = 0
       que=input().split(" ")
       ans=input().split(" ")
       for i in range(4):
             for j in range(4):
                    if que[i] == ans[j] and i != j:
                         b = b + 1
                    if que[i] == ans[j] and i == j:
                         h = h + 1
       print(str(h) + " " + str(b))
   except:break

Python: import sys

for line in sys.stdin:
    a = list(map(int, line.split()))
    b = list(map(int, line.split()))
    hit = 0
    blow = 0
    for i in range(4):
        if b[i] == a[i]:
            hit += 1
        elif b[i] in a:
            blow += 1
    print(hit,blow)

Python: import sys 
import numpy as np 

def main():
    input_line = []
#     test_line = ['9 1 8 2', '4 1 5 9', '4 6 8 2', '4 6 3 2']
    
#     for line in test_line:
#         input_line.append(line.split())
    
    
    
    for line in sys.stdin:
        input_line.append(line.split())
    #print(input_line)

    
    for i in range(0,len(input_line),2):
        #hit number
        arrary1 = np.array(input_line[i], dtype=float)
        arrary2 = np.array(input_line[i+1], dtype=float)
        hit_vec = arrary1 - arrary2
        hit_list = list(hit_vec)
        hitnumber = hit_list.count(0.)
        #print(hit_list.count(0.))
        
        #blow number
        
        
        
        
        #get the hit location and remove
        hit_loc = [i for i,x in enumerate(hit_list) if x == 0]
        blow_vec1 = np.delete(arrary1, hit_loc)
        blow_vec2 = np.delete(arrary2, hit_loc)
        blownumber = len(set(blow_vec1).intersection(blow_vec2))
        #print(len(set(blow_vec1).intersection(blow_vec2)))
        
        print(hitnumber,blownumber)


        
if __name__ == '__main__':
    main()

Python: while True:
    try:
        a=[int(i) for i in input().split()]
        b=[int(i) for i in input().split()]
    except:
        break
    hit,blow=0,0
    for i,j in zip(a,b):
        if j in a:
            blow+=1
        if i==j:
            hit+=1

Python: import sys
e=iter(map(lambda a:a.split(),sys.stdin))
for a,b in zip(e,e):
 h=sum([1 for i in range(4)if a[i]==b[i]])
 w=4-len(set(a)-set(b))-h
 print(h,w)

Python: while True:
  try:
    a = map(int, raw_input().split())
    b = map(int, raw_input().split())
  except:
    break
  ab = zip(a, b)
  hit = 0
  blow = 0
  for xa, xb in ab:
    if xa == xb:
      hit  += 1
    elif xa in b:
      blow += 1
  print('%d %d' % (hit, blow))

Python: while 1:
    try:
        A = input().split()
        B = input().split()
        hit = len([i for i in range(len(A)) if B[i] == A[i]])
        blow = len([i for i in range(len(A)) if B[i] in A]) - hit
        print(str(hit) + " " + str(blow))
    except:
        break

Python: ans = 0
while True:
    try:
        a = list(int(x) for x in input().split())
        b = list(int(x) for x in input().split())
    except EOFError:
        break
    hit = 0
    brow =0
    for i in range(4):
        if a[i] == b[i]:
            hit += 1
        else:
            for j in range(4):
                if(i != j and a[i] == b[j]):
                    brow += 1
                    
    print(str(hit)+' '+str(brow))

Python: while(True):
    try:
        a = list(map(int, input().split()))
        b = list(map(int, input().split()))
        h = [c-d for c,d in zip(a,b)].count(0)
        v = sum([a.count(d) for d in b]) - h
        print(h,v)
    except:
        break

Python: import sys
e=iter(map(lambda a:a.split(),sys.stdin))
for a,b in zip(e,e):
 h=sum([1 for i in range(4)if a[i]==b[i]])
 print(h,4-len(set(a)-set(b))-h)

Python: import sys
count = 0
for line in sys.stdin:
    if count % 2 == 0:
        a = list(map(int, line.split()))
    else:
        b = list(map(int, line.split()))
        hit, brow = 0, 0
        for i in range(4):
            if a[i] == b[i]:
                hit += 1
            elif a[i] in b:
                brow += 1
        print(hit, brow)
    count += 1

Python: import sys

v = None
for i in sys.stdin:
    if v:
        h = 0
        for j, n in enumerate(i.split()):
            if n == v[j]:
                h += 10
            elif n in v:
                h += 1
        v = None
        print(h // 10, h % 10)
    else:
        v = i.split()

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]))