#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int gi() {
  int x = 0, o = 1;
  char ch = getchar();
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') o = -1, ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return x * o;
}
int n, m, q, lim[N], l[N], r[N], s[N], tp;
long long t, a[N], b[N], w[N];
struct line {
  int k;
  long long b;
  long long f(int x) { return 1ll * k * x + b; }
} st[N];
bool check(line a, line b, line c) {
  return 1ll * (a.b - b.b) * (c.k - a.k) <= 1ll * (a.b - c.b) * (b.k - a.k);
}
bool check3(long long *a, long long lim) {
  tp = 0;
  for (int i = 0; i <= n; i++) {
    line l = (line){i, a[i] - 1ll * m * i};
    while (tp > 1 && check(st[tp - 1], st[tp], l)) --tp;
    st[++tp] = l;
  }
  for (int i = 0; i <= m; i++) {
    while (tp > 1 && st[tp - 1].f(i) <= st[tp].f(i)) --tp;
    if (st[tp].f(i) + w[i] - 1ll * n * i + 1ll * n * m < lim) return 0;
  }
  return 1;
  return 1;
}
int check2(int cnt, int val) {
  for (int i = 1; i <= m; i++) l[i] = 0, r[i] = n;
  for (int i = 1; i <= m; i++)
    if (~lim[i]) l[i] = r[i] = lim[i];
  for (int i = 1; i <= cnt; i++) l[i] = r[i] = val;
  for (int i = m - 1; i; i--) l[i] = max(l[i], l[i + 1]);
  for (int i = 2; i <= m; i++) r[i] = min(r[i], r[i - 1]);
  long long tmp = t;
  for (int i = 1; i <= m; i++) tmp -= l[i];
  if (tmp < 0) return 1;
  tmp = t;
  for (int i = 1; i <= m; i++) tmp -= r[i];
  if (tmp > 0) return -1;
  return 0;
}
bool check(int cnt, int val) {
  int L = val, R = n, ans = -1;
  for (int i = 1; i <= cnt; i++)
    if (~lim[i]) R = min(R, lim[i]);
  for (int i = 1; i <= m; i++) L = max(L, lim[i]);
  while (L <= R) {
    int mid = (L + R) >> 1, t = check2(cnt, mid);
    if (t > 0)
      R = mid - 1;
    else if (t == 0)
      ans = mid, R = mid - 1;
    else
      L = mid + 1;
  }
  if (!~ans) return 0;
  check2(cnt, ans);
  memset(s, 0, sizeof(s));
  for (int i = 1; i <= m; i++) ++s[l[i]], --s[r[i]];
  for (int i = 1; i <= n; i++) s[i] += s[i - 1];
  long long tmp = t;
  int p = 0;
  for (int i = 1; i <= m; i++) tmp -= l[i];
  for (int i = 0;; i++) {
    if (tmp >= s[i])
      tmp -= s[i];
    else {
      p = i;
      break;
    }
  }
  for (int i = 1; i <= m; i++) w[i] = max(l[i], min(p, r[i]));
  for (int i = 1; i <= m; i++)
    if (w[i] == p && r[i] > p && tmp) --tmp, ++w[i];
  sort(w + 1, w + m + 1);
  for (int i = 1; i <= m; i++) w[i] += w[i - 1];
  return check3(b, t) && check3(a, a[n]);
}
int main() {
  memset(lim, -1, sizeof(lim));
  cin >> n >> m;
  for (int i = 1; i <= n; i++) a[i] = gi(), b[i] = gi();
  sort(a + 1, a + n + 1);
  sort(b + 1, b + n + 1);
  for (int i = 1; i <= n; i++) a[i] += a[i - 1], b[i] += b[i - 1];
  cin >> q;
  for (int i = 1, x; i <= q; i++) x = gi(), lim[x] = gi();
  cin >> t;
  int l = 0, r = m;
  while (l < r) {
    int mid = (l + r + 1) >> 1;
    if (check(mid, 0))
      l = mid;
    else
      r = mid - 1;
  }
  if (!l) return cout << -1 << ' ' << -1, 0;
  int ans1 = l;
  l = 0, r = n;
  while (l < r) {
    int mid = (l + r + 1) >> 1;
    if (check(ans1, mid))
      l = mid;
    else
      r = mid - 1;
  }
  cout << ans1 << ' ' << l << '\n';
  return 0;
}
