#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200010;
int n, m, x[MAXN], t[MAXN], ans[MAXN], Tin;
vector<int> l, r;
vector<pair<int, int> > seg;
int create() {
  seg.push_back(make_pair(0, 0));
  l.push_back(0);
  r.push_back(0);
  return (int)seg.size() - 1;
}
void upd(int pos, int bg, int ed, int p, int q, int tin, int val) {
  if (q < p || q < bg || ed < p) return;
  if (p <= bg && ed <= q) {
    seg[pos] = make_pair(tin, val);
    return;
  }
  int mid = (bg + ed) >> 1;
  if (!l[pos]) {
    int aux = create();
    l[pos] = aux;
  }
  if (!r[pos]) {
    int aux = create();
    r[pos] = aux;
  }
  upd(l[pos], bg, mid, p, q, tin, val);
  upd(r[pos], mid + 1, ed, p, q, tin, val);
}
pair<int, int> qry(int pos, int bg, int ed, int id) {
  if (!pos) return make_pair(0, 0);
  if (bg == ed) return seg[pos];
  int mid = (bg + ed) >> 1;
  pair<int, int> cur = seg[pos];
  if (id <= mid)
    return max(cur, qry(l[pos], bg, mid, id));
  else
    return max(cur, qry(r[pos], mid + 1, ed, id));
}
int main() {
  create();
  create();
  scanf("%d %d", &n, &m);
  int N = 1e9;
  vector<pair<int, int> > frog;
  for (int i = 1; i <= n; i++) {
    scanf("%d %d", &x[i], &t[i]);
    frog.push_back(make_pair(x[i], i));
  }
  sort(frog.begin(), frog.end());
  for (int i = (int)frog.size() - 1; i >= 0; i--) {
    int id = frog[i].second;
    upd(1, 0, N, x[id], x[id] + t[id], ++Tin, id);
  }
  multiset<pair<int, int> > s;
  multiset<pair<int, int> >::iterator it;
  for (int i = 0, p, b; i < m; i++) {
    scanf("%d %d", &p, &b);
    int id = qry(1, 0, N, p).second;
    s.insert(make_pair(p, b));
    if (id) {
      int T = t[id];
      vector<pair<int, int> > clean;
      for (it = s.find(make_pair(p, b)); it != s.end(); it++) {
        if ((*it).first > x[id] + t[id]) break;
        clean.push_back(*it);
        t[id] += (*it).second;
      }
      for (int j = 0; j < (int)clean.size(); j++) s.erase(s.find(clean[j]));
      ans[id] += (int)clean.size();
      upd(1, 0, N, x[id] + T, x[id] + t[id], ++Tin, id);
    }
  }
  for (int i = 1; i <= n; i++) printf("%d %d\n", ans[i], t[i]);
}
