#include <bits/stdc++.h>
using namespace std;
const int N = 200200;
int n, m;
long long a[N];
long long x[N];
int cnt[N];
long long pos[N];
long long b[N];
set<pair<long long, int> > c, d, e;
void tryErase(int id) {
  if (c.find(make_pair(x[id], id)) == c.end()) return;
  while (true) {
    auto it = c.lower_bound(make_pair(x[id] + 1, -1));
    if (it == c.end()) break;
    int p = it->second;
    if (x[id] + a[id] < x[p] + a[p]) break;
    c.erase(it);
    d.erase(make_pair(x[p] + a[p], p));
  }
}
void read() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%lld%lld", &x[i], &a[i]);
    c.insert(make_pair(x[i], i));
    d.insert(make_pair(x[i] + a[i], i));
  }
  for (int i = 0; i < n; i++) tryErase(i);
  return;
}
void tryEat(int id) {
  while (true) {
    auto it = e.lower_bound(make_pair(x[id] + a[id] + 1, -1));
    if (it == e.begin()) break;
    it--;
    if (it->first < x[id]) break;
    a[id] += b[it->second];
    cnt[id]++;
    e.erase(it);
  }
  return;
}
int main() {
  read();
  for (int i = 0; i < m; i++) {
    scanf("%lld%lld", &pos[i], &b[i]);
    auto it = d.lower_bound(make_pair(pos[i], -1));
    if (it == d.end() || x[it->second] > pos[i]) {
      e.insert(make_pair(pos[i], i));
      continue;
    }
    int id = it->second;
    d.erase(make_pair(x[id] + a[id], id));
    a[id] += b[i];
    cnt[id]++;
    tryEat(id);
    d.insert(make_pair(x[id] + a[id], id));
    tryErase(id);
  }
  for (int i = 0; i < n; i++) printf("%d %lld\n", cnt[i], a[i]);
  return 0;
}
