#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
map<int, int> mp;
int n, m, x[N], len[N], p[N], sz[N], t[4 * N], ate[N];
int in[N];
bool cmp(int i, int j) { return x[i] < x[j]; }
void build(int v, int tl, int tr) {
  if (tl == tr)
    t[v] = x[in[tl]] + len[in[tl]];
  else {
    int tm = (tl + tr) / 2;
    build(v << 1, tl, tm);
    build(v << 1 | 1, tm + 1, tr);
    t[v] = max(t[v * 2], t[v * 2 + 1]);
  }
}
int get(int v, int tl, int tr, int val) {
  if (tl == tr) {
    if (t[v] >= val)
      return tl;
    else
      return n + 1;
  }
  if (v >= 2 * n) return v;
  int tm = (tl + tr) / 2;
  if (t[v * 2] >= val) {
    return get(v * 2, tl, tm, val);
  }
  return get(v * 2 + 1, tm + 1, tr, val);
}
void upd(int v, int tl, int tr, int pos, int val) {
  if (tl == tr) {
    t[v] += val;
    return;
  }
  int tm = (tl + tr) / 2;
  if (pos <= tm)
    upd(v * 2, tl, tm, pos, val);
  else
    upd(v * 2 + 1, tm + 1, tr, pos, val);
  t[v] = max(t[v * 2], t[v * 2 + 1]);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> x[i] >> len[i];
    in[i] = i;
  }
  sort(in + 1, in + n + 1, cmp);
  build(1, 1, n);
  multiset<pair<int, int> > s;
  for (int i = 1; i <= m; i++) {
    cin >> p[i] >> sz[i];
    int pos = get(1, 1, n, p[i]);
    if (pos <= n && x[in[pos]] <= p[i]) {
      ate[in[pos]]++;
      upd(1, 1, n, pos, sz[i]);
      len[in[pos]] += sz[i];
      while (!s.empty()) {
        auto d = s.lower_bound({x[in[pos]] + len[in[pos]] + 1, -1});
        if (d != s.begin() && (--d)->first >= x[in[pos]]) {
          upd(1, 1, n, pos, d->second);
          len[in[pos]] += d->second;
          s.erase(d);
          ate[in[pos]]++;
        } else
          break;
      }
    } else
      s.insert({p[i], sz[i]});
  }
  for (int i = 1; i <= n; i++) cout << ate[i] << ' ' << len[i] << '\n';
}
