#include <bits/stdc++.h>
using std::make_pair;
using std::multiset;
using std::pair;
const int N = 200005;
multiset<pair<long long, int> > s;
long long t[N << 2];
int n, m, ans[N], x, siz;
struct frog {
  int pos, id;
  long long l;
} a[N];
bool cmp(frog x, frog y) { return x.pos < y.pos; }
void push_up(int x) { t[x] = std::max(t[x << 1], t[x << 1 | 1]); }
void build(int k, int l, int r) {
  if (l == r) {
    t[k] = a[l].pos + a[l].l;
    return;
  }
  int mid = (l + r) >> 1;
  build(k << 1, l, mid);
  build(k << 1 | 1, mid + 1, r);
  push_up(k);
}
int query(int k, int l, int r, int x) {
  if (t[k] < x) return -1;
  if (l == r) {
    if (a[l].pos > x) return -1;
    return l;
  }
  int mid = (l + r) >> 1;
  if (t[k << 1] >= x) return query(k << 1, l, mid, x);
  return query(k << 1 | 1, mid + 1, r, x);
}
void modify(int k, int l, int r, int x, int y) {
  if (l == r) {
    t[k] += y;
    return;
  }
  int mid = (l + r) >> 1;
  if (x <= mid)
    modify(k << 1, l, mid, x, y);
  else
    modify(k << 1 | 1, mid + 1, r, x, y);
  push_up(k);
}
bool cmp2(frog x, frog y) { return x.id < y.id; }
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d%lld", &a[i].pos, &a[i].l), a[i].id = i;
  std::sort(a + 1, a + n + 1, cmp);
  build(1, 1, n);
  s.insert(make_pair(-1, 0));
  s.insert(make_pair(10000000000000000, 0));
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &x, &siz);
    int id = query(1, 1, n, x);
    if (id == -1) {
      s.insert(make_pair(x, siz));
      continue;
    }
    modify(1, 1, n, id, siz);
    ans[a[id].id]++;
    a[id].l += siz;
    while (1) {
      multiset<pair<long long, int> >::iterator itt =
          s.upper_bound(make_pair(a[id].l + a[id].pos + 1, -1));
      itt--;
      pair<long long, int> tt = *itt;
      if (tt.first == -1) break;
      if (a[id].pos > tt.first) break;
      ans[a[id].id]++, a[id].l += tt.second;
      modify(1, 1, n, id, tt.second);
      s.erase(itt);
    }
  }
  std::sort(a + 1, a + n + 1, cmp2);
  for (int i = 1; i <= n; i++) printf("%d %lld\n", ans[i], a[i].l);
}
