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