#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 10;
long long _n, b[N], ans[N], len[N], a[N], n, m, ind[N];
long long mx[N << 2];
bool cmp(long long x, long long y) { return a[x] < a[y]; }
multiset<pair<long long, long long> > g;
void ins(long long k, long long l, long long r, long long x, long long val) {
  if (l == r) {
    mx[k] = val;
    return;
  }
  long long mid = l + r >> 1;
  if (x <= mid)
    ins(k << 1, l, mid, x, val);
  else
    ins(k << 1 | 1, mid + 1, r, x, val);
  mx[k] = max(mx[k << 1], mx[k << 1 | 1]);
}
long long query(long long k, long long l, long long r, long long val) {
  if (mx[k] < val) return -1;
  if (l == r) {
    if (val <= mx[k] && a[b[l]] <= val) return l;
    return -1;
  }
  long long mid = l + r >> 1;
  return val <= mx[k << 1] ? query(k << 1, l, mid, val)
                           : query(k << 1 | 1, mid + 1, r, val);
}
signed main() {
  long long x, y;
  scanf("%lld %lld", &n, &m);
  for (register long long i = (1); i <= (n); ++i)
    scanf("%lld %lld", &a[i], &len[i]), b[i] = i;
  sort(b + 1, b + 1 + n, cmp);
  for (register long long i = (1); i <= (n); ++i)
    ins(1, 1, n, i, len[b[i]] + a[b[i]]);
  for (register long long i = (1); i <= (m); ++i) {
    scanf("%lld %lld", &x, &y);
    long long p = query(1, 1, n, x);
    if (p == -1)
      g.insert({x, y});
    else {
      long long ind = p;
      p = b[p];
      ans[p]++;
      len[p] += y;
      while (g.size()) {
        multiset<pair<long long, long long> >::iterator it =
            g.lower_bound({a[p], 0});
        if (it == g.end() || it->first > a[p] + len[p]) break;
        ans[p]++;
        len[p] += it->second;
        g.erase(it);
      }
      ins(1, 1, n, ind, len[p] + a[p]);
    }
  }
  for (register long long i = (1); i <= (n); ++i)
    printf("%lld %lld\n", ans[i], len[i]);
  return 0;
}
