#include <bits/stdc++.h>
using namespace std;
long long readint(long long &x) {
  x = 0;
  char c = getchar();
  while (c < '0' || c > '9') c = getchar();
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return x;
}
long long qmax(long long a, long long b) { return (a > b) ? a : b; }
long long qmin(long long a, long long b) { return (a < b) ? a : b; }
void putint(long long x) {
  if (!x) return;
  putint(x / 10ll);
  putchar(x % 10ll + '0');
}
void output(long long x) {
  if (!x)
    putchar('0');
  else
    putint(x);
}
long long n, m;
pair<pair<long long, long long>, long long> turtle[500500];
multiset<pair<long long, long long> > food;
long long dat[500500], val[500500];
long long cnt[500500], ans[500500];
void update(long long now, long long x) {
  long long init = now;
  val[init] += x;
  while (now <= n) {
    dat[now] = qmax(dat[now], val[init]);
    now += (now & -now);
  }
}
long long lmt = 0;
int binary_search(long long x) {
  long long pos = 0;
  for (long long i = lmt; i >= 0; i--)
    if (pos + (1 << i) <= n && dat[pos + (1 << i)] < x) pos += (1 << i);
  return pos + 1;
}
long long do_expand(long long pos, long long add) {
  multiset<pair<long long, long long> >::iterator it =
      food.lower_bound(make_pair(turtle[pos].first.first, 0));
  while (it != food.end() && it->first <= val[pos + 1] + add) {
    multiset<pair<long long, long long> >::iterator lst = it;
    it++;
    cnt[turtle[pos].second]++;
    add += lst->second;
    food.erase(lst);
  }
  return add;
}
int main() {
  readint(n), readint(m);
  while ((1 << lmt) <= n) lmt++;
  lmt--;
  for (int i = 0; i < n; i++)
    readint(turtle[i].first.first), readint(turtle[i].first.second),
        turtle[i].second = i;
  sort(turtle, turtle + n);
  for (int i = 0; i < n; i++)
    update(i + 1, turtle[i].first.first + turtle[i].first.second);
  for (int j = 0; j < m; j++) {
    long long food_pos, food_size;
    readint(food_pos), readint(food_size);
    long long pos = binary_search(food_pos) - 1;
    if (pos >= n || turtle[pos].first.first > food_pos)
      food.insert(make_pair(food_pos, food_size));
    else {
      cnt[turtle[pos].second]++;
      long long add = food_size;
      add = do_expand(pos, add);
      update(pos + 1, add);
    }
  }
  for (int i = 0; i < n; i++)
    ans[turtle[i].second] = val[i + 1] - turtle[i].first.first;
  for (int i = 0; i < n; i++)
    output(cnt[i]), putchar(' '), output(ans[i]), puts("");
  return 0;
}
