#include <bits/stdc++.h>
using namespace std;
int x[100005], y[100005];
pair<int, int> p[100005];
pair<pair<int, int>, int> r[100005];
int ans[100005];
vector<int> ht;
struct st {
  int st[800005];
  void init() { memset(st, 0, sizeof(st)); }
  void update(int n, int s, int e, int idx, int v) {
    if (s == e)
      st[n] = max(st[n], v);
    else {
      int mid = (s + e) / 2;
      if (idx <= mid)
        update(n + n, s, mid, idx, v);
      else
        update(n + n + 1, mid + 1, e, idx, v);
      st[n] = max(st[n + n], st[n + n + 1]);
    }
  }
  int query(int n, int s, int e, int l, int r) {
    if (s > r || l > e) return -2e9;
    if (l <= s && e <= r) return st[n];
    int mid = (s + e) / 2;
    int q1 = query(n + n, s, mid, l, r);
    int q2 = query(n + n + 1, mid + 1, e, l, r);
    return max(q1, q2);
  }
} st[2];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  int c, h, a, b, j;
  scanf("%d", &c);
  for (int i = 1; i <= c; i++) {
    scanf("%d%d", &x[i], &y[i]);
    p[i] = pair<int, int>(x[i], y[i]);
    ht.push_back(y[i]);
  }
  sort(p + 1, p + 1 + c);
  for (int i = 1; i <= c; i++) x[i] = p[i].first, y[i] = p[i].second;
  scanf("%d", &h);
  for (int i = 1; i <= h; i++) {
    scanf("%d%d", &a, &b);
    r[i] = pair<pair<int, int>, int>(pair<int, int>(a, b), i);
    ht.push_back(b);
  }
  sort(r + 1, r + 1 + h);
  sort(ht.begin(), ht.end());
  ht.erase(unique(ht.begin(), ht.end()), ht.end());
  int N = ht.size();
  int l = 1;
  for (int i = 1; i <= h; i++) {
    a = r[i].first.first, b = r[i].first.second, j = r[i].second;
    while (l <= c) {
      if (x[l] <= a) {
        int k = lower_bound(ht.begin(), ht.end(), y[l]) - ht.begin() + 1;
        st[0].update(1, 1, N, k, n - x[l] + m - y[l]);
        st[1].update(1, 1, N, k, n - x[l] + y[l]);
        l++;
      } else
        break;
    }
    int k = lower_bound(ht.begin(), ht.end(), b) - ht.begin() + 1;
    ans[j] = max(ans[j], st[0].query(1, 1, N, 1, k) - (n - a) - (m - b));
    ans[j] = max(ans[j], st[1].query(1, 1, N, k, N) - (n - a) - b);
  }
  st[0].init();
  st[1].init();
  l = c;
  for (int i = h; i >= 1; i--) {
    a = r[i].first.first, b = r[i].first.second, j = r[i].second;
    while (l >= 1) {
      if (x[l] >= a) {
        int k = lower_bound(ht.begin(), ht.end(), y[l]) - ht.begin() + 1;
        st[0].update(1, 1, N, k, x[l] + m - y[l]);
        st[1].update(1, 1, N, k, x[l] + y[l]);
        l--;
      } else
        break;
    }
    int k = lower_bound(ht.begin(), ht.end(), b) - ht.begin() + 1;
    ans[j] = max(ans[j], st[0].query(1, 1, N, 1, k) - a - (m - b));
    ans[j] = max(ans[j], st[1].query(1, 1, N, k, N) - a - b);
  }
  int mn = 2e9, idx = 0;
  for (int i = 1; i <= h; i++) {
    if (ans[i] < mn) {
      mn = ans[i];
      idx = i;
    }
  }
  printf("%d\n%d\n", mn, idx);
}
