#include <bits/stdc++.h>
using namespace std;
template <class T>
bool umin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool umax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
pair<int, int> frog[400009], s[400009 << 2], mosq[400009];
set<int> sg;
multiset<pair<int, int> > onmosq;
set<pair<int, int> > in[400009];
map<int, int> pm;
int ans[400009];
int dsbul(int k) {
  int son = *(--sg.end());
  if (*sg.begin() > k) return -1;
  if (son < k) return son;
  return *(--sg.upper_bound(k));
}
void upd(int p, int v, int ind, int nd, int x, int y) {
  if (x == y) {
    in[x].insert(make_pair(v, ind));
    umin(s[nd], make_pair(v, ind));
    return;
  }
  int mid = (x + y) >> 1;
  if (p <= mid)
    upd(p, v, ind, nd << 1, x, mid);
  else
    upd(p, v, ind, nd << 1 | 1, mid + 1, y);
  s[nd] = min(s[nd << 1], s[nd << 1 | 1]);
}
pair<int, int> tap(int l, int r, int nd, int x, int y) {
  if (l > y or x > r) return make_pair(2147483647, -1);
  if (l <= x and y <= r) return s[nd];
  int mid = (x + y) >> 1;
  pair<int, int> i1 = tap(l, r, nd << 1, x, mid);
  pair<int, int> i2 = tap(l, r, nd << 1 | 1, mid + 1, y);
  return min(i1, i2);
}
void poz(int p, int v, int ind, int nd, int x, int y) {
  if (x == y) {
    pair<int, int> nn;
    in[x].erase(in[x].find(make_pair(v, ind)));
    if (in[x].size() == 0)
      nn = make_pair(2147483647, -1);
    else
      nn = *in[x].begin();
    s[nd] = nn;
    return;
  }
  int mid = (x + y) >> 1;
  if (p <= mid)
    poz(p, v, ind, nd << 1, x, mid);
  else
    poz(p, v, ind, nd << 1 | 1, mid + 1, y);
  s[nd] = min(s[nd << 1], s[nd << 1 | 1]);
}
int main() {
  for (int i = 0; i < 400009 << 2; i++) s[i] = make_pair(2147483647, -1);
  int n, m, c = 1;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    int posf, lent;
    scanf("%d%d", &posf, &lent);
    frog[i] = make_pair(posf, lent);
  }
  for (int i = 1; i <= m; i++) {
    int posm, szm;
    scanf("%d%d", &posm, &szm);
    mosq[i] = make_pair(posm, szm);
    pm[posm] = 1;
    sg.insert(posm);
  }
  for (typeof((pm).begin()) it = (pm).begin(); it != (pm).end(); it++)
    it->second = ++c;
  pm[-1] = 1;
  for (int i = 1; i <= n; i++) {
    int where = frog[i].first + frog[i].second;
    upd(pm[dsbul(where)], frog[i].first, i, 1, 1, c);
  }
  for (int i = 1; i <= m; i++) {
    pair<int, int> k = tap(pm[mosq[i].first], c, 1, 1, c);
    if (k.second == -1 or k.first > mosq[i].first) {
      onmosq.insert(mosq[i]);
      continue;
    }
    poz(pm[dsbul(frog[k.second].first + frog[k.second].second)],
        frog[k.second].first, k.second, 1, 1, c);
    frog[k.second].second += mosq[i].second;
    upd(pm[dsbul(frog[k.second].first + frog[k.second].second)],
        frog[k.second].first, k.second, 1, 1, c);
    ans[k.second]++;
    while (onmosq.size() > 0) {
      if ((*(--onmosq.end())).first < frog[k.second].first) break;
      pair<int, int> it =
          *onmosq.lower_bound(make_pair(frog[k.second].first, -1));
      if (it.first - frog[k.second].first > frog[k.second].second) break;
      poz(pm[dsbul(frog[k.second].first + frog[k.second].second)],
          frog[k.second].first, k.second, 1, 1, c);
      frog[k.second].second += it.second;
      upd(pm[dsbul(frog[k.second].first + frog[k.second].second)],
          frog[k.second].first, k.second, 1, 1, c);
      ans[k.second]++;
      onmosq.erase(onmosq.find(it));
    }
  }
  for (int i = 1; i <= n; i++) printf("%d %d\n", ans[i], frog[i].second);
  return 0;
}
