#include <bits/stdc++.h>
using namespace std;
const int NN = 2e5 + 10;
long long maxn[4 * NN];
int eat[NN];
long long len[NN];
struct mas {
  int p;
  int s;
};
struct fr {
  int p;
  long long l;
  int id;
} frog[NN];
bool cmp(fr x, fr y) { return (x.p < y.p); }
struct cmpse {
  bool operator()(const mas &x, const mas &y) { return (x.p < y.p); }
};
bool cmpsee(mas x, mas y) { return x.p < y.p; }
multiset<mas, cmpse> se;
void update(int cur) { maxn[cur] = max(maxn[cur * 2], maxn[cur * 2 + 1]); }
void build(int l, int r, int cur) {
  if (l == r) {
    maxn[cur] = frog[l].p + frog[l].l;
    return;
  }
  int mid = (l + r) >> 1;
  build(l, mid, cur * 2);
  build(mid + 1, r, cur * 2 + 1);
  update(cur);
}
int find(int l, int r, int pos, int cur) {
  if (l == r) {
    if (maxn[cur] >= pos && frog[l].p <= pos) return l;
    return -1;
  }
  int mid = (l + r) >> 1;
  if (frog[mid + 1].p > pos) {
    return find(l, mid, pos, cur * 2);
  } else {
    if (maxn[cur * 2] >= pos) {
      return find(l, mid, pos, cur * 2);
    } else if (maxn[cur * 2 + 1] >= pos) {
      return find(mid + 1, r, pos, cur * 2 + 1);
    } else
      return -1;
  }
}
void cov(int l, int r, int obj, int val, int cur) {
  if (l == r) {
    maxn[cur] = val;
    return;
  }
  int mid = (l + r) >> 1;
  if (obj <= mid)
    cov(l, mid, obj, val, cur * 2);
  else if (obj > mid)
    cov(mid + 1, r, obj, val, cur * 2 + 1);
  update(cur);
}
int n, m;
int main() {
  memset(maxn, 0, sizeof(maxn));
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d%lld", &frog[i].p, &frog[i].l);
    frog[i].id = i;
  }
  sort(frog + 1, frog + n + 1, cmp);
  build(1, n, 1);
  memset(eat, 0, sizeof(eat));
  for (int i = 1; i <= m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    int obj = find(1, n, x, 1);
    set<mas>::iterator iter;
    if (obj == -1) {
      mas neww;
      neww.p = x;
      neww.s = y;
      se.insert(neww);
    } else {
      eat[frog[obj].id]++;
      frog[obj].l += y;
      set<mas>::iterator iter;
      set<mas>::iterator it;
      int can = 0;
      mas neww;
      neww.p = frog[obj].p;
      iter = se.lower_bound(neww);
      it = iter;
      for (; iter != se.end(); ++iter) {
        mas temp = *iter;
        if (frog[obj].p + frog[obj].l >= temp.p) {
          can++;
          eat[frog[obj].id]++;
          frog[obj].l += temp.s;
        } else {
          break;
        }
      }
      for (int j = 1; j <= can; j++) {
        it = se.erase(it);
      }
      cov(1, n, obj, frog[obj].p + frog[obj].l, 1);
    }
  }
  for (int i = 1; i <= n; i++) len[frog[i].id] = frog[i].l;
  for (int i = 1; i <= n; i++) {
    printf("%d %lld\n", eat[i], len[i]);
  }
  return 0;
}
