#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using PII = pair<int, int>;
const int N = 2e5 + 10;
int cnt[N];
LL len[N];
struct node {
  int x, id, cnt;
  LL len;
  node(int x, LL t, int id) : x(x), len(t), id(id), cnt(0) {}
  bool operator<(const node &b) const {
    return x + len < b.x + b.len || x + len == b.x + b.len && x > b.x;
  }
};
set<node> S;
set<node>::iterator del(set<node>::iterator j) {
  cnt[j->id] = j->cnt;
  len[j->id] = j->len;
  return S.erase(j);
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    int x, t;
    scanf("%d%d", &x, &t);
    S.insert(node(x, t, i));
  }
  for (auto i = S.begin(); i != S.end(); i++) {
    auto j = i;
    while (i != S.begin() && (--j)->x >= i->x) {
      del(j);
      j = i;
    }
  }
  multiset<PII> mos;
  for (int i = 1; i <= m; i++) {
    int p, b;
    scanf("%d%d", &p, &b);
    auto f = S.lower_bound((node){p, 0, 0});
    if (f == S.end()) {
      mos.insert((PII){p, b});
    } else {
      if (f->x <= p) {
        auto item = *f;
        item.len += b;
        item.cnt++;
        auto mo = mos.lower_bound({f->x, 0});
        while (mo != mos.end() && mo->first <= item.x + item.len) {
          item.len += mo->second;
          item.cnt++;
          mo = mos.erase(mo);
        }
        auto j = f;
        j++;
        while (j != S.end() && (item.x + item.len >= j->x + j->len)) j = del(j);
        S.erase(f);
        S.insert(item);
      } else {
        mos.insert((PII){p, b});
      }
    }
  }
  for (auto i = S.begin(); i != S.end(); i = del(i))
    ;
  for (int i = 1; i <= n; i++) printf("%d %lld\n", cnt[i], len[i]);
  return 0;
}
