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
def hit_blow(num):
   hits = 0
   blows = 0
   emp1 = [0,0,0,0]
   emp2 = [0,0,0,0]
   num.append(emp1)
   num.append(emp2)
   for i in range(0,4):
       i = i*2
       for j in range(0,4):
           j = j*2
           if num[0][i] == num[1][j] and num[2][int(i/2)] == 0 and num[3][int(j/2)] == 0:
               if i ==j :
                   hits += 1
               else:
                   blows += 1
               num[2][int(i/2)] = 1
               num[3][int(j/2)] = 1
   print(hits,blows)

flag = 0
num = []
for line in sys.stdin.readlines():
   if flag == 0:
       num.append(line)
       flag = 1
   elif flag == 1:
       num.append(line)
       flag = 2
   if flag == 2:
       flag = 0
       hit_blow(num)
       del num[:]

Python: while True:
  try:
    alst = input().split()
    blst = input().split()

    hit = brow = 0

    for i in range(4):
      for j in range(4):
        if alst[i] == blst[j]:
          if i == j:
            hit += 1
          else:
            brow += 1

    print(hit, brow)

  except EOFError:
    break

Python: while(1):
	try:
		a = [int(i) for i in input().split()]
		b = [int(i) for i in input().split()]
		hit = 0
		for i,j in zip(a,b):
			if i == j:
				hit += 1
		sa = set(a)
		sb = set(b)
		u = sa & sb
		blow = len(u) - hit
		print(hit, blow)
	except EOFError:
		break

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

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

Python: while 1:
    try:a=list(map(int,input().split()))
    except:break
    b=list(map(int, input().split()))
    h=0
    for i in range(4):
        if a[i]==b[i]: h+=1
    print(h,len(set(a)&set(b))-h)

Python: while True:
    try:
        a = list(map(int, input().split()))
        b = list(map(int, input().split()))
    except:
        break
    print(sum(x == y for x, y in zip(a, b)),  sum(a[i] != b[i] and a[i] in b for i in range(4)))

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

Python: import sys
res=[]

for (l,text) in enumerate(sys.stdin):
    if not l%2:
        a=list(map(int,text.split()))
    else:
        h=0
        b=0
        for (i,j) in enumerate(map(int,text.split())):
            if a[i]==j:
                h=h+1
            elif j in a:
                b=b+1
        res.extend([[h,b]])
[print(i[0],i[1]) for i in res]

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_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 True:
	try:
		a = list(map(int, input().split()))
		b = list(map(int, input().split()))
	except: break
	
	hit = blow = 0
	for i in range(4):
		if a[i] == b[i]:
			hit += 1
			b[i] = -1
	for i in range(4):
		if b[i] >= 0:
			if b[i] in a: blow += 1
	print(hit, blow)
"""
while True:
    try:
        a = list(map(int, input().split()))
        b = list(map(int, input().split()))
    except:
        break
    hit = blow = 0
    for i in range(4):
        if (a[i] == b[i]):
            hit += 1
            b[i] = -1
    for i in range(4):
        if b[i] >= 0:
            if b[i] in a:
                 blow += 1
    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: import sys
def main():
    for line in sys.stdin:
        a = list(map(int, line.split()))
        b = list(map(int, input().split()))

        hi, bl = 0, 0
        for x in range(4):
            for y in range(4):
                if a[x] == b[y]:
                    if x == y:
                        hi += 1
                    else:
                        bl += 1

        print(hi, bl)


if __name__ == "__main__":
    main()

Python: while True:
 l1=list(map(int,input().split()))
 l2=list(map(int,input().split()))
 hit=blow=0
 for i in l1:
   for s in l2:
    if i==s:
     if l1.index(i)==l2.index(s):
       hit+=1
     else:
       blow+=1
 print(hit,blow)

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

Python: while 1:
    try:a=list(map(int,input().split()))
    except:break
    b=list(map(int, input().split()))
    h=0
    for i,j in zip(a,b):h+=i==j
    print(h,len(set(a)&set(b))-h)

Python: #!/usr/bin/env python3
# -*- coding: utf-8 -*-

# Copyright  : @Huki_Hara
# Created    : 2015-03-05

while True:
    try:
        a=list(map(int, input().split()))
        b=list(map(int, input().split()))
    except:
        break;

    hit=0
    blow=0
    for i in range(4):
        if a[i] == b[i]: 
            hit += 1
    for i in range(4):
        for j in range(4):
            if i != j and a[i] == b[j]: blow += 1

    print(str(hit) + " " + str(blow))

Python: while True:
  try:
    a_set = list(map(int, input().split()))
    b_set = list(map(int, input().split()))
  except EOFError:
    break
  hit = 0
  blow = 0
  for i in range(4):
    if a_set[i] == b_set[i]:
      hit += 1
  for i in range(4):
    for j in range(4):
      if a_set[i] == b_set[j] and i != j:
        blow += 1
  print(hit,blow)

Python: import sys
while(True):
    try:
        hit=0
        blow=0
        a=[int(i) for i in input().split()]
        b=[int(i) for i in input().split()]
        for i in range(len(a)):
            for j in range(len(b)):
                if a[i]==b[j]:
                    if i==j:
                        hit+=1
                    else:
                        blow+=1
                    break
        print(hit,blow)
    except EOFError:
        sys.exit()