#!/usr/bin/env python
# coding: utf-8


def hit_and_blow(a, b):
    hits = 0
    blows = 0
    for i in xrange(4):
        if b[i] == a[i]:
            hits += 1
        else:
            for j in xrange(4):
                if j == i:
                    continue
                if b[i] == a[j]:
                    blows += 1
    return hits, blows


def main():
    inputs = []
    while 1:
        try:
            inputs.append([int(x) for x in raw_input().split(" ")])
        except EOFError:
            break
    quads = []
    for quad in inputs:
        quads.append(quad)
        if quads.__len__() == 2:
            print "%d %d" % hit_and_blow(*quads)
            quads = []

if __name__ == '__main__':
    main()