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