#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7, SEGN = 2 << (32 - __builtin_clz(N - 1));
int n, m;
int x[N], t[N];
long long y[N];
struct frog {
  long long st, en;
};
frog seg[SEGN];
int cntEat[N];
int sorted[N];
void build(int si = 0, int ss = 0, int se = n - 1) {
  if (ss == se) {
    seg[si] = {x[sorted[ss]], y[sorted[ss]]};
    return;
  }
  int md = ss + (se - ss) / 2, rt = 2 * si + 1, lf = rt++;
  build(lf, ss, md);
  build(rt, md + 1, se);
  seg[si] = {min(seg[lf].st, seg[rt].st), max(seg[lf].en, seg[rt].en)};
}
void update(int i, int q, int si = 0, int ss = 0, int se = n - 1) {
  if (ss == se) {
    seg[si].en += q;
    cntEat[sorted[ss]]++;
    y[sorted[ss]] += q;
    return;
  }
  int md = ss + (se - ss) / 2, rt = 2 * si + 1, lf = rt++;
  if (i <= md)
    update(i, q, lf, ss, md);
  else
    update(i, q, rt, md + 1, se);
  seg[si] = {min(seg[lf].st, seg[rt].st), max(seg[lf].en, seg[rt].en)};
}
int query(int p, int si = 0, int ss = 0, int se = n - 1) {
  if (ss == se) return ss;
  int md = ss + (se - ss) / 2, rt = 2 * si + 1, lf = rt++;
  if (seg[lf].en >= p)
    return query(p, lf, ss, md);
  else
    return query(p, rt, md + 1, se);
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    cin >> x[i] >> t[i];
    y[i] = x[i] + t[i];
  }
  iota(sorted, sorted + n, 0);
  sort(sorted, sorted + n, [](int i, int j) {
    return pair<long long, long long>{x[i], y[i]} <
           pair<long long, long long>{x[j], y[j]};
  });
  build();
  multiset<pair<long long, long long> > bugs;
  for (int i = 0; i < m; ++i) {
    int p, b;
    cin >> p >> b;
    int f = query(p);
    if (x[sorted[f]] <= p && y[sorted[f]] >= p) {
      update(f, b);
      while (1) {
        auto it = bugs.upper_bound({x[sorted[f]], -1});
        if (it == bugs.end() || it->first > y[sorted[f]]) break;
        update(f, it->second);
        bugs.erase(it);
      }
    } else
      bugs.insert({p, b});
  }
  for (int i = 0; i < n; ++i) {
    cout << cntEat[i] << " " << y[i] - x[i] << '\n';
  }
}
