#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
struct Node {
  int pos, id, cnt;
  long long end;
  bool operator<(const Node &rhs) const { return pos < rhs.pos; }
} a[maxn];
int n, m;
long long c[maxn];
int lowbit(int x) { return x & -x; }
void Modify(int x, long long d) {
  for (; x <= n; x += lowbit(x)) c[x] = max(c[x], d);
}
long long Query(int x) {
  long long res = 0;
  for (; x; x -= lowbit(x)) res = max(res, c[x]);
  return res;
}
int gao(int x, long long d) {
  if (Query(x) < d) return -1;
  int L = 1, R = x + 1;
  while (L < R) {
    int mid = (L + R) >> 1;
    if (Query(mid) >= d)
      R = mid;
    else
      L = mid + 1;
  }
  return L;
}
bool cmp(Node &x, Node &y) { return x.id < y.id; }
int main(int argc, char **argv) {
  while (scanf("%d%d", &n, &m) == 2) {
    memset(c, 0, sizeof(*c) * n + 10);
    for (int i = 1; i <= n; ++i) {
      int x, t;
      scanf("%d%d", &x, &t);
      a[i].pos = x;
      a[i].id = i;
      a[i].cnt = 0;
      a[i].end = x + t;
    }
    sort(a + 1, a + n + 1);
    for (int i = 1; i <= n; ++i) Modify(i, a[i].end);
    Node qr;
    qr.cnt = -1;
    qr.id = -1;
    qr.end = -1;
    multiset<pair<int, int> > s;
    for (int i = 0; i < m; ++i) {
      int p, t;
      scanf("%d%d", &p, &t);
      qr.pos = p;
      int x = upper_bound(a + 1, a + 1 + n, qr) - a;
      --x;
      if (x < 1 || (x = gao(x, p)) == -1) {
        s.insert(make_pair(p, t));
        continue;
      }
      a[x].end += t;
      ++a[x].cnt;
      while (s.size()) {
        multiset<pair<int, int> >::iterator it =
            s.lower_bound(make_pair(a[x].pos, -1));
        if (it == s.end() || it->first > a[x].end) {
          break;
        }
        a[x].end += it->second;
        ++a[x].cnt;
        s.erase(it);
      }
      Modify(x, a[x].end);
    }
    sort(a + 1, a + n + 1, cmp);
    for (int i = 1; i <= n; ++i) {
      cout << a[i].cnt << " " << a[i].end - a[i].pos << endl;
    }
  }
  return 0;
}
