#include<stdio.h>

int main(){
 int im[4],bl[4],i,hit,blow,j;
 
 while(scanf("%d %d %d %d",im,im+1,im+2,im+3)!=EOF){
  scanf("%d %d %d %d",bl,bl+1,bl+2,bl+3);
  for(hit=0,blow=0,i=0;i<4;i++){
   if(im[i]==bl[i]) hit++;
   for(j=0;j<4;j++)
    if(i!=j&&im[i]==bl[j]) blow++;
   printf("%d %d\n",hit,blow);
 }

 return 0;
}