#include <bits/stdc++.h>
using namespace std;
const int SIZ = 200000;
char buf1[SIZ], *p1 = buf1, *p2 = buf1;
char gchar() {
  if (p1 == p2) p1 = buf1, p2 = buf1 + fread(buf1, 1, SIZ, stdin);
  return p1 == p2 ? EOF : *p1++;
}
int read() {
  int ret = 0;
  register int c;
  while ((c = gchar()) > '9' || c < '0')
    ;
  ret = c - '0';
  while ((c = gchar()) >= '0' && c <= '9') ret = ret * 10 + c - '0';
  return ret;
}
void write(long long x) {
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
int n, m;
set<pair<pair<long long, long long>, int> > ha;
multiset<pair<long long, long long> > hkreporter;
int num[200004];
pair<pair<long long, long long>, int> p[200004];
long long ret[200004];
bool cmp(pair<pair<long long, long long>, int> A,
         pair<pair<long long, long long>, int> B) {
  if (A.first.first != B.first.first) return A.first.first > B.first.first;
  return A.first.second < B.first.second;
}
int main() {
  n = read(), m = read();
  for (int i = 1; i <= n; i++)
    p[i].first.second = read(), p[i].first.first = p[i].first.second + read(),
    p[i].second = i, ret[i] = p[i].first.first - p[i].first.second;
  sort(p + 1, p + 1 + n, cmp);
  for (int i = 1; i <= n; i++)
    if (i == 1 || p[i].first.second < p[i - 1].first.second) {
      ha.insert(p[i]);
    } else
      p[i] = p[i - 1];
  while (m--) {
    long long p = read(), t = read();
    set<pair<pair<long long, long long>, int> >::iterator it =
        ha.lower_bound(make_pair(make_pair(p, -1), 0));
    if (it == ha.end() || (*it).first.second > p) {
      hkreporter.insert(make_pair(p, t));
    } else {
      pair<pair<long long, long long>, int> v = (*it);
      ha.erase(it);
      int id = v.second;
      num[id]++, ret[id] += t;
      v.first.first += t;
      while (!hkreporter.empty()) {
        multiset<pair<long long, long long> >::iterator mit =
            hkreporter.lower_bound(make_pair(v.first.second, 0));
        if (mit == hkreporter.end()) break;
        pair<long long, long long> mm = (*mit);
        if (mm.first > v.first.first) break;
        hkreporter.erase(mit);
        v.first.first += mm.second;
        num[id]++, ret[id] += mm.second;
      }
      while (!ha.empty()) {
        set<pair<pair<long long, long long>, int> >::iterator sit =
            ha.upper_bound(make_pair(make_pair(v.first.first, 1e18), -1));
        if (sit == ha.begin()) break;
        sit--;
        pair<pair<long long, long long>, int> ss = (*sit);
        if (ss.first.second < v.first.second) break;
        ha.erase(sit);
      }
      ha.insert(v);
    }
  }
  for (int i = 1; i <= n; i++)
    write(num[i]), putchar(' '), write(ret[i]), puts("");
}
