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: # -*- 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 ])
        print(str(hit) + ' ' +str(blow))
    except:
        break

Python: try:
    while True:
        a1,a2,a3,a4=map(int,input().split())
        b1,b2,b3,b4=map(int,input().split()) 
        h=0
        b=0
        if a1==b1:
            h+=1
        if a2==b2:
            h+=1
        if a3==b3:
            h+=1
        if a4==b4:
            h+=1
        A = [a1,a2,a3,a4]
        B = [b1,b2,b3,b4]
    
        for i in A:
            for j in B:
                if i == j:
                    b +=1
        b = b - h
        
        print(h,b)
except EOFError:
    pass

Python: from __future__ import (division, absolute_import, print_function,
                        unicode_literals)
from sys import stdin

while True:
    a = stdin.readline().strip()
    if not a:
        break
    b = stdin.readline().strip()
    if a == b:
        print('4 0')
        continue
    hit = sum(int(a[i] == b[i]) for i in xrange(0, 7, 2))
    blow = sum(int(b[i] in a) for i in xrange(0, 7, 2)) - hit
    print(hit, blow)

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 EOFError:
        break

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

def main():
    while True:
        try:
            A=input().split()
            B=input().split()

            Hit=0
            Blow=0

            for b in B:
                if b in A:
                    index=B.index(b)
                    print(index)
                    if b==A[index]:
                        Hit+=1

                    else:
                        Blow+=1
            print(Hit,Blow)

        except:
            break
            
    
        
if __name__ == '__main__':
    main()

Python: while True:
    try:
        a1,a2,a3,a4=map(int,input().split())
        b1,b2,b3,b4=map(int,input().split())

        A=[a1,a2,a3,a4]
        B=[b1,b2,b3,b4]

        b=0
        h=0
        for i in A:
            if i in B:
                b+=1
            else:
                continue
        for i in range(4):
            if A[i]==B[i]:
                h+=1
            else:
                continue
        print(h,b-h)
    except EOFError:
        break

Python: import sys

even = True
for s in sys.stdin:
    if even:
        even = not even
        a = list(map(int, s.split()))
    else:
        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)

Python: while True:
    try:
        h=0
        b=0
        a1,a2,a3,a4=map(int,input().split())
        b1,b2,b3,b4=map(int,input().split())
        if a1==b1:
            h+=1
        if a2==b2:
            h+=1
        if a3==b3:
            h+=1
        if a4==b4:
            h+=1
        if a1==b2 or a1==b3 or a1==b4:
            b+=1
        if a2==b1 or a2==b3 or a2==b4:
            b+=1
        if a3==b1 or a3==b2 or a3==b4:
            b+=1
        if a4==b1 or a4==b2 or a4==b3:
            b+=1
        print(h,b)
    except:
        break

Python: while True:
    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 True:
    try:
        a=input().split()
        b=input().split()
        hit=0
        blow=0

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

        print(hit, blow)
        
    except EOFError:
        break

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

Python: hit = blow = 0
a = [*map(int,input().split(' '))]
b = [*map(int,input().split(' '))]
for i in range(4):
	if a[i] == b[i]:
		hit += 1
	if a[i] == b[i-1]:
		blow += 1
print(hit, blow)

Python: while True:
    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: while True:
   try:
      A = input().split()
      B = input().split()
      h = 0
      b = 0
      for i in range(4):
         for j in range(4):
            if A[i] == B[j]:
               if i == j:
                  h += 1
               else:
                  b += 1
            else:
               pass
      print(h, b)
   except EOFError:
      break

Python: while True:
    try:
        ansa=input().split()
        ansb=input().split()
    except:
        break

    hit = sum((1 for a, b in zip(ansa, ansb) if a == b))
    blow = sum((1 for a in ansa if a in ansb))

    print(hit, blow - hit)

Python: try:
 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)
except:
  pass

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
array = []
for i in sys.stdin.readlines():
    array.append(i.rstrip().split())
for i in range(0,len(array),2):
    hit = 0
    blow = 0
    for i2 in range(4):
        if array[i][i2] == array[i+1][i2]:
            hit += 1
        for i3 in range(4):
            if array[i][i2] == array[i+1][i3]:
                if i2 == i3:
                    continue
                blow += 1
    print(str(hit)+" "+str(blow))