#include <bits/stdc++.h>
using namespace std;
long long n, m;
long long x[1000005], t[1000005], p[1000005], b[1000005];
long long key[1000005], cnt = 0, hs[1000005], num = 0;
long long ans[1000005], id[1000005];
struct node {
  long long l, r;
  long long mn, lz;
} s[1000005 << 2];
inline void build(long long k, long long l, long long r) {
  s[k].l = l;
  s[k].r = r;
  s[k].mn = s[k].lz = 0x3f3f3f3f;
  if (l == r) return;
  long long mid = (l + r) >> 1;
  build(k << 1, l, mid);
  build(k << 1 | 1, mid + 1, r);
}
inline void pushdown(long long k) {
  if (s[k].lz != 0x3f3f3f3f) {
    s[k << 1].mn = min(s[k << 1].mn, s[k].lz);
    s[k << 1].lz = min(s[k << 1].lz, s[k].lz);
    s[k << 1 | 1].mn = min(s[k << 1 | 1].mn, s[k].lz);
    s[k << 1 | 1].lz = min(s[k << 1 | 1].lz, s[k].lz);
    s[k].lz = 0x3f3f3f3f;
  }
}
inline void modify(long long k, long long l, long long r, long long x) {
  if (l > r) return;
  if (l <= s[k].l && s[k].r <= r) {
    s[k].mn = min(s[k].mn, x);
    s[k].lz = min(s[k].lz, x);
    return;
  }
  pushdown(k);
  long long mid = (s[k].l + s[k].r) >> 1;
  if (r <= mid)
    modify(k << 1, l, r, x);
  else if (l > mid)
    modify(k << 1 | 1, l, r, x);
  else
    modify(k << 1, l, mid, x), modify(k << 1 | 1, mid + 1, r, x);
  s[k].mn = min(s[k << 1].mn, s[k << 1 | 1].mn);
}
inline long long query(long long k, long long v) {
  if (s[k].l == s[k].r) return s[k].mn;
  pushdown(k);
  long long mid = (s[k].l + s[k].r) >> 1;
  if (v <= mid)
    return query(k << 1, v);
  else
    return query(k << 1 | 1, v);
}
set<pair<long long, long long> > st;
inline void operate(long long i, long long j) {
  ans[j]++;
  long long L = upper_bound(hs + 1, hs + num + 1, x[j] + t[j]) - hs;
  long long R = upper_bound(hs + 1, hs + num + 1, x[j] + t[j] + b[i]) - hs - 1;
  modify(1, L, R, lower_bound(hs + 1, hs + num + 1, x[j]) - hs);
  t[j] += b[i];
  vector<pair<long long, long long> > dels;
  set<pair<long long, long long> >::iterator it =
      st.lower_bound(make_pair(L, 0));
  while (it != st.end() && it->first <= R) {
    dels.push_back(*it);
    it++;
  }
  for (__typeof(dels.begin()) itt = dels.begin(); itt != dels.end(); itt++)
    st.erase(st.find(*itt));
  for (__typeof(dels.begin()) itt = dels.begin(); itt != dels.end(); itt++)
    operate(itt->second, j);
}
signed main() {
  scanf("%lld%lld", &n, &m);
  for (long long i = 1; i <= n; i++) scanf("%lld%lld", &x[i], &t[i]);
  for (long long i = 1; i <= m; i++) scanf("%lld%lld", &p[i], &b[i]);
  for (long long i = 1; i <= n; i++) key[++cnt] = x[i];
  for (long long i = 1; i <= m; i++) key[++cnt] = p[i];
  sort(key + 1, key + cnt + 1);
  key[0] = -0x3f3f3f3f;
  for (long long i = 1; i <= cnt; i++)
    if (key[i] != key[i - 1]) hs[++num] = key[i];
  build(1, 1, num);
  for (long long i = 1; i <= n; i++) {
    long long l = lower_bound(hs + 1, hs + num + 1, x[i]) - hs;
    long long r = upper_bound(hs + 1, hs + num + 1, x[i] + t[i]) - hs - 1;
    id[l] = i;
    modify(1, l, r, l);
  }
  for (long long i = 1; i <= m; i++) {
    long long l = lower_bound(hs + 1, hs + num + 1, p[i]) - hs;
    long long val = query(1, l);
    if (val == 0x3f3f3f3f) {
      st.insert(make_pair(l, i));
      continue;
    }
    long long j = id[val];
    operate(i, j);
  }
  for (long long i = 1; i <= n; i++) printf("%lld %lld\n", ans[i], t[i]);
  return 0;
}
