#include <bits/stdc++.h>
using namespace std;
const int Mod = 1e9 + 7;
const int N = 5e5 + 5;
int n, m, p[N], b[N], x[N], t[N], c[N], id[N];
long long B[N], ll[N];
multiset<pair<int, int> >::iterator it;
multiset<pair<int, int> > s;
int nn, X[N];
inline void Ins(int x, long long y) {
  while (x <= nn) {
    B[x] = max(B[x], y);
    x += x & -x;
  }
}
long long cal(int x) {
  long long res = -1;
  while (x) {
    res = max(res, B[x]);
    x -= x & -x;
  }
  return res;
}
int main() {
  memset(B, -1, sizeof(B));
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d %d", x + i, t + i);
    ll[i] = t[i];
    X[++nn] = x[i];
  }
  for (int i = 1; i <= m; i++) {
    scanf("%d %d", p + i, b + i);
    X[++nn] = p[i];
  }
  sort(X + 1, X + 1 + nn);
  nn = unique(X + 1, X + 1 + nn) - X - 1;
  for (int i = 1; i <= n; i++) {
    int pos = lower_bound(X + 1, X + 1 + nn, p[i]) - X;
    Ins(pos, -1);
  }
  for (int i = 1; i <= n; i++) {
    int pos = lower_bound(X + 1, X + 1 + nn, x[i]) - X;
    id[pos] = i;
    Ins(pos, x[i] + t[i]);
  }
  for (int i = 1; i <= m; i++) {
    int r = lower_bound(X + 1, X + 1 + nn, p[i]) - X;
    int l = 1;
    while (l < r) {
      int mid = l + r >> 1;
      if (cal(mid) >= p[i])
        r = mid;
      else
        l = mid;
      if (l + 1 == r) {
        if (cal(l) >= p[i])
          r--;
        else
          l++;
      }
    }
    if (cal(l) < p[i]) {
      s.insert(make_pair(p[i], b[i]));
      continue;
    }
    c[id[l]]++;
    ll[id[l]] += b[i];
    Ins(l, x[id[l]] + ll[id[l]]);
    while (s.size()) {
      it = s.lower_bound(make_pair(x[id[l]], 0));
      if (it == s.end()) break;
      if (cal(l) >= (*it).first) {
        c[id[l]]++;
        ll[id[l]] += (*it).second;
        Ins(l, x[id[l]] + ll[id[l]]);
        s.erase(it);
      } else
        break;
    }
  }
  for (int i = 1; i <= n; i++) printf("%d %I64d\n", c[i], ll[i]);
}
