#include <bits/stdc++.h>
struct Frog {
  int id;
  int left;
  int right;
};
struct Midge {
  int size;
  int count;
};
using namespace std;
bool comp(const Frog& f1, const Frog& f2) { return f1.left < f2.left; }
vector<int> st;
vector<Frog> frogs;
void build(int v, int tl, int tr) {
  if (tl == tr) {
    st[v] = frogs[tl].right;
    return;
  }
  int m = (tl + tr) >> 1;
  build(v * 2 + 1, tl, m);
  build(v * 2 + 2, m + 1, tr);
  st[v] = max(st[v * 2 + 2], st[v * 2 + 1]);
}
void update(int v, int tl, int tr, int pos, int val) {
  if (tl == tr) {
    st[v] += val;
    return;
  }
  int m = (tl + tr) >> 1;
  if (pos <= m) {
    update(v * 2 + 1, tl, m, pos, val);
  } else {
    update(v * 2 + 2, m + 1, tr, pos, val);
  }
  st[v] = max(st[v * 2 + 2], st[v * 2 + 1]);
}
int get(int v, int tl, int tr, int pos) {
  if (tl == tr) {
    if (st[v] < pos) {
      return -1;
    }
    return tl;
  }
  int m = (tl + tr) >> 1;
  if (st[v * 2 + 1] >= pos) {
    return get(v * 2 + 1, tl, m, pos);
  } else if (st[v * 2 + 2] >= pos) {
    return get(v * 2 + 2, m + 1, tr, pos);
  }
  return -1;
}
int main() {
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  frogs.resize(n);
  vector<int> lengths(n);
  vector<int> counts(n);
  for (int i = 0; i < n; ++i) {
    int pos, length;
    cin >> pos >> length;
    frogs[i] = Frog{i, pos, pos + length};
    lengths[i] = length;
  }
  sort(frogs.begin(), frogs.end(), comp);
  st.resize(4 * n);
  map<int, Midge> midges;
  build(0, 0, n - 1);
  for (int i = 0; i < m; ++i) {
    int pos, size;
    cin >> pos >> size;
    int iFrog = get(0, 0, n - 1, pos);
    if (iFrog != -1 && frogs[iFrog].left <= pos) {
      frogs[iFrog].right += size;
      lengths[frogs[iFrog].id] += size;
      counts[frogs[iFrog].id] += 1;
      update(0, 0, n - 1, iFrog, size);
      if (!midges.empty()) {
        auto nearestMidge = midges.lower_bound(frogs[iFrog].left);
        while (nearestMidge != midges.end() &&
               nearestMidge->first <= frogs[iFrog].right) {
          frogs[iFrog].right += nearestMidge->second.size;
          lengths[frogs[iFrog].id] += nearestMidge->second.size;
          counts[frogs[iFrog].id] += nearestMidge->second.count;
          update(0, 0, n - 1, iFrog, nearestMidge->second.size);
          midges.erase(nearestMidge);
          nearestMidge = midges.lower_bound(frogs[iFrog].left);
        }
      }
    } else {
      auto midge = midges.find(pos);
      if (midge == midges.end()) {
        midges[pos] = Midge{size, 1};
      } else {
        midge->second.size += size;
        midge->second.count += 1;
      }
    }
  }
  for (int i = 0; i < n; ++i) {
    cout << counts[i] << ' ' << lengths[i] << '\n';
  }
  return 0;
}
