#include <bits/stdc++.h>
int main() {
  while (1) {
    int a[4], b[4];
    int eat = 0, bite = 0;
    for (int i = 0; i < 4; i++) {
      std::cin >> a[i];
    }
    if (a[0] == 0) {
      break;
    }
    for (int i = 0; i < 4; i++) {
      std::cin >> b[i];
    }
    for (int i = 0; i < 4; i++) {
      for (int j = 0; j < 4; j++) {
        if (i == j && a[i] == b[j]) {
          eat++;
        } else if (a[i] == b[j]) {
          bite++;
        }
      }
    }
    std::cout << eat << " " << bite << std::endl;
  }
  return 0;
}
