#include <bits/stdc++.h>
using namespace std;
int readint() {
  int x = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') ch = getchar();
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + (ch ^ 48);
    ch = getchar();
  }
  return x;
}
int P[20];
int pn;
void printint(int x) {
  pn = 0;
  if (x == 0) {
    putchar('0');
    return;
  }
  while (x) {
    P[++pn] = x % 10;
    x /= 10;
  }
  while (pn) putchar('0' + P[pn--]);
}
void printll(long long x) {
  pn = 0;
  if (x == 0) {
    putchar('0');
    return;
  }
  while (x) {
    P[++pn] = x % 10ll;
    x /= 10ll;
  }
  while (pn) putchar('0' + P[pn--]);
}
const int N = 5e5 + 5;
const int MAXN = 1000000000;
int n, m, lst = -1;
pair<pair<int, int>, int> tt[N];
int ans1[N];
long long ans2[N];
set<pair<pair<int, int>, int> > fd;
set<pair<pair<int, int>, int> > st;
int main() {
  n = readint();
  m = readint();
  for (int i = 1; i <= n; i++) {
    tt[i].first.first = readint();
    tt[i].first.second = readint();
    tt[i].second = i;
    ans2[i] = tt[i].first.second;
  }
  sort(tt + 1, tt + 1 + n);
  for (int i = 1; i <= n; i++) {
    int l = max(tt[i].first.first, lst + 1);
    int r = min(tt[i].first.first + tt[i].first.second, MAXN);
    if (l <= r) {
      st.insert(make_pair(make_pair(l, r), tt[i].second));
      lst = r;
    }
  }
  for (int i = 1; i <= m; i++) {
    int p = readint(), b = readint();
    set<pair<pair<int, int>, int> >::iterator it =
        st.lower_bound(make_pair(make_pair(p, MAXN), MAXN));
    fd.insert(make_pair(make_pair(p, b), i));
    if (it == st.begin()) continue;
    it--;
    int x = it->second;
    int l = it->first.first;
    int r = it->first.second;
    st.erase(it);
    while (true) {
      it = fd.lower_bound(make_pair(make_pair(l, -1), -1));
      if (it == fd.end()) break;
      if (it->first.first > r) break;
      ans2[x] += it->first.second;
      ans1[x]++;
      r = min(MAXN, r + (it->first.second));
      fd.erase(it);
    }
    st.insert(make_pair(make_pair(l, r), x));
    while (true) {
      it = st.lower_bound(make_pair(make_pair(l, r), MAXN));
      if (it == st.end()) break;
      int ll = it->first.first;
      int rr = it->first.second;
      int xx = it->second;
      if (ll > r) break;
      st.erase(it);
      if (rr <= r) continue;
      ll = r + 1;
      st.insert(make_pair(make_pair(ll, rr), xx));
      break;
    }
  }
  for (int i = 1; i <= n; i++) {
    printint(ans1[i]);
    putchar(' ');
    printll(ans2[i]);
    puts("");
  }
  return 0;
}
