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

if __name__ == '__main__':
    data = []
    for line in sys.stdin:
        data.append([int(x) for x in line.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 d == choice_b[i]:
                        hit += 1
                    else:
                        blow += 1

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

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

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)
                    if b==A[index]:
                        Hit+=1

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

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

Python: import sys

def solve():
    A = []
    B = []
    for i, line in enumerate(sys.stdin):
        t = tuple(map(int, line.split()))
        if i % 2 == 0:
            A.append(t)
        else:
            B.append(t)
    
    for a, b in zip(A, B):
        hit, blow = 0, 0
        
        for i, bb in enumerate(b):
            for j, aa in enumerate(a):
                if bb == aa and i == j:
                    hit += 1
                    break
                elif bb == aa and i != j:
                    blow += 1
                    break
        print(hit, blow)
        

if __name__ == "__main__":
    solve()

Python: 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):
        try:
            if i == a.index(b[i]):
                hit += 1
            else:
                blow += 1
        except:
            pass
    print("{} {}".format(hit, blow))

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

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
        for j in range(4):
            if i != j and a[i] == b[j]:
                blow +=1
    print(hit,blow)

Python: import sys
lines = []
for index, line in enumerate(sys.stdin):
  line = line.strip()
  if index%2 == 0:
    lines.append( [line] )
  else:
    lines[-1].append( line )
#print(lines)
lines = iter(lines)
for line in lines:
  i1 = line
  xs = list(map(int, i1[0].split() ))
  ys = list(map(int, i1[1].split() ))
  full_match = 0
  spec_match = 0
  for x, y in zip(list(xs), list(ys)):
    #print(x, y, y in xs)
    if x == y:
      full_match += 1
    elif y in xs:
      spec_match += 1
  print(full_match, spec_match)

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

def hitBlow(a, b):
    hit = 0
    blow = 0
    for i in range(len(a)):
        if a[i] == b[i]:
            hit += 1
        for j in range(i+1, len(b)):
            if a[i] == b[j]:
                blow += 1

    return [hit, blow]

for s in sys.stdin:
    a = list(map(int, s.split()))
    b = list(map(int, input().split()))

    hit, blow = hitBlow(a, b)

    print(hit, blow)

Python: try:
    while True:
        #標準入力
        a_line = list(map(int,input().split()))
        b_line = list(map(int,input().split()))
        num1 = 0
        num2 = 0
        #場所も番号も同じならnum1数字が同じならnum2にいれる
        for num in range(0,4):
            if a_line[num] == b_line[num]:
                num1 += 1
                continue
            else:pass
            if a_line[num] in b_line:num2 += 1
            else:pass
        print(str(num1) + " " + str(num2))
#EOFErrorをひろう
except EOFError:
    pass

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 = 0
        for i in range(len(a)):
            if a [i] == b [i]:
                hit += 1
        blow = -hit
        for i in range(10):
            blow += min(a.count(i),b.count(i))
        print(hit,blow)

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
a = list(map(int, input().split()))
for b in sys.stdin:
    b = list(map(int, b.split()))
    hit = 0
    blow = 0
    for i in range(4):
        try:
            if i == a.index(b[i]):
                hit += 1
            else:
                blow += 1
        except:
            pass
    print("{} {}".format(hit, blow))

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

Python: def HB(A,B):
    hit=0
    blow=0
    for i in range(4):
        for j in range(4):
            if A[i]==B[j]:
                if i==j:
                    hit+=1
                else:
                    blow+=1
    return [hit,blow]
while True:
    try:
        A=input().split()
        B=input().split()
        print(HB(A,B)[0] , HB(A,B)[1] )
    except:
        break

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