#include <bits/stdc++.h>
using namespace std;
struct frog {
  int id;
  long long pos, tongue, cnt;
  bool operator<(const frog& who) const { return pos < who.pos; }
};
int n, m, i, lim, pos, val;
frog F[200011];
set<pair<long long, int> > S;
multiset<pair<long long, long long> > M;
pair<long long, long long> ans[200011];
int main() {
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; i++) {
    scanf("%lld%lld", &F[i].pos, &F[i].tongue);
    F[i].id = i, F[i].cnt = 0;
  }
  sort(F + 1, F + n + 1);
  lim = -1;
  for (i = 1; i <= n; i++) {
    if (F[i].pos + F[i].tongue <= lim) continue;
    lim = F[i].pos + F[i].tongue;
    S.insert(make_pair(F[i].pos + F[i].tongue, i));
  }
  for (i = 1; i <= m; i++) {
    scanf("%d%d", &pos, &val);
    auto e = S.lower_bound(make_pair(1LL * pos, -1));
    if (e == S.end()) {
      M.insert(make_pair(pos, val));
      continue;
    }
    if (F[e->second].pos > pos) {
      M.insert(make_pair(pos, val));
      continue;
    }
    int fr = e->second;
    long long ini = F[fr].pos + F[fr].tongue;
    F[fr].tongue += val;
    F[fr].cnt++;
    while (true) {
      auto e = M.lower_bound(make_pair(F[fr].pos, -1));
      if (e == M.end()) break;
      if (e->first > F[fr].pos + F[fr].tongue) break;
      F[fr].tongue += e->second;
      F[fr].cnt++;
      M.erase(e);
    }
    while (true) {
      auto e = S.lower_bound(make_pair(ini, -1));
      ;
      if (e == S.end()) break;
      if (e->first > F[fr].pos + F[fr].tongue) break;
      S.erase(e);
    }
    S.insert(make_pair(F[fr].pos + F[fr].tongue, fr));
  }
  for (i = 1; i <= n; i++) ans[F[i].id] = make_pair(F[i].tongue, F[i].cnt);
  for (i = 1; i <= n; i++) printf("%lld %lld\n", ans[i].second, ans[i].first);
  return 0;
}
