#include <bits/stdc++.h>
using namespace std;
int n, m;
long long p, x[200010], t[200010], b[200010], tr[200010], cnt[200010];
pair<long long, int> a[200010];
set<pair<long long, long long> > s;
void modify(long long x, long long c) {
  for (; x < 200010; x += x & -x) tr[x] = max(tr[x], c);
}
long long ask(long long x) {
  long long res = 0;
  for (; x; x -= x & -x) res = max(res, tr[x]);
  return res;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%lld%lld", &x[i], &t[i]);
    a[i] = make_pair(x[i], i);
  }
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) modify(i, x[a[i].second] + t[a[i].second]);
  for (int i = 1; i <= m; i++) {
    scanf("%lld%lld", &p, &b[i]);
    long long l = 1, r = upper_bound(a + 1, a + n + 1, make_pair(p, n)) - a - 1;
    if (p < a[1].first) continue;
    if (p > ask(r)) {
      s.insert(make_pair(p, i));
      continue;
    }
    while (l < r) {
      long long mid = l + r >> 1;
      if (ask(mid) >= p)
        r = mid;
      else
        l = mid + 1;
    }
    if (a[l].first > p) {
      s.insert(make_pair(p, i));
      continue;
    }
    long long id = a[l].second;
    t[id] += b[i];
    modify(l, x[id] + t[id]);
    cnt[id]++;
    for (auto it = s.lower_bound(make_pair(x[id], 0));
         it != s.end() && (*it).first <= x[id] + t[id];) {
      t[id] += b[(*it).second];
      modify(l, x[id] + t[id]);
      cnt[id]++;
      s.erase(it++);
    }
  }
  for (int i = 1; i <= n; i++) printf("%lld %lld\n", cnt[i], t[i]);
  return 0;
}
