import std.stdio, std.conv, std.string, std.algorithm, std.range;

void main()
{
    while(true)
    {
        auto a = readln.split.map!(to!int), b = readln.split.map!(to!int);
        if(a.length != 4) break;
        auto hit = iota(4).map!(i => a[i] == b[i] ? 1 : 0).reduce!"a + b",
             blow = a.map!(n => count(b, n)).reduce!"a + b" - hit;
        writeln(hit, " ", blow);
    }
}