#include <bits/stdc++.h>
using namespace std;
int main() {
  int arr1[120] = {0};
  int arr2[120] = {0};
  int n, m, cnt = 900, cnt2 = 0, cnt1 = 900, cnt3 = 0, y;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> arr1[i];
    cin >> arr2[i];
  }
  for (int i = n; i < m + n; i++) {
    cin >> arr1[i];
    cin >> arr2[i];
  }
  for (int i = 0; i < n + m; i++) {
    y = abs(arr1[i] - arr2[i]) + abs(arr1[i + n] - arr2[i + n]);
    if (i < n) {
      if (y < cnt) {
        cnt = min(cnt, y);
        cnt2++;
      }
    } else {
      if (y < cnt1) {
        cnt1 = min(cnt, y);
        cnt3++;
      }
    }
  }
  cout << cnt2 << endl << cnt3;
}
