while True:

    try:
        ansa=hoge1.split()
        ansb=hoge2.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)