import sys

f=0

for s in sys.stdin:

    f=1-f

    b=list(map(int,s.split()))

    if f:

        a=b

        continue

    c1=0

    c2=0

    for i,e in enumerate(b):

        if e==a[i]: c1+=1

        elif e in a: c2+=1

    print(c1, c2)
import sys

f=1

for s in sys.stdin:

    b=list(map(int,s.split()))

    if f:

        a=b

        f=0

        continue

    c1=0

    c2=0

    for i,e in enumerate(b):

        if e==a[i]: c1+=1

        elif e in a: c2+=1

    print(c1, c2)

    f=1
import sys

f = 0
for s in sys.stdin:
    f = 1 - f
    b = list(map(int, s.split()))
    if f:
        a = b
        continue
    c1 = 0
    c2 = 0
    for i, e in enumerate(b):
        if e == a[i]:
            c1 += 1
        elif e in a:
            c2 += 1
    print(c1, c2)

import sys

f = 1
for s in sys.stdin:
    b = list(map(int, s.split()))
    if f:
        a = b
        f = 0
        continue
    c1 = 0
    c2 = 0
    for i, e in enumerate(b):
        if e == a[i]:
            c1 += 1
        elif e in a:
            c2 += 1
    print(c1, c2)
    f = 1

-f = 0 +f = 1 -    f = 1 - f +        f = 0 +    f = 1