#include <bits/stdc++.h>
using namespace std;
const int maxn = 222222;
pair<int, int> A[maxn], tmp1[maxn];
pair<long long, int> tmp2[maxn];
pair<int, long long> Ans[maxn];
set<pair<long long, int> > frg;
multiset<pair<int, int> > msq;
map<int, int> id;
bool vis[maxn];
int main() {
  int N, M;
  scanf("%d%d", &N, &M);
  for (int a, b, i = 1; i <= N; ++i) {
    scanf("%d%d", &a, &b);
    Ans[i].second = b;
    A[i] = make_pair(a, a + b);
    id[a] = i;
  }
  sort(A + 1, A + 1 + N);
  int r = -1;
  for (int i = 1; i <= N; ++i) {
    if (A[i].second <= r)
      vis[i] = true;
    else
      r = A[i].second;
  }
  for (int i = 1; i <= N; ++i)
    if (!vis[i]) frg.insert(make_pair(A[i].second, A[i].first));
  for (int a, b, i = 1; i <= M; ++i) {
    scanf("%d%d", &a, &b);
    msq.insert(make_pair(a, b));
    set<pair<long long, int> >::iterator aa = frg.lower_bound(make_pair(a, 0));
    if (aa != frg.end() && (*aa).second <= a) {
      multiset<pair<int, int> >::iterator bb = msq.find(make_pair(a, b));
      int ll = (*aa).second, tot = 0, idd = id[ll];
      long long rr;
      for (rr = (*aa).first; bb != msq.end() && (*bb).first <= rr; ++bb)
        ++Ans[idd].first, rr += (*bb).second, Ans[idd].second += (*bb).second,
            tmp1[++tot] = *bb;
      for (int j = 1; j <= tot; ++j)
        if (msq.count(tmp1[j])) msq.erase(tmp1[j]);
      for (tot = 0; aa != frg.end() && (*aa).first <= rr; ++aa)
        tmp2[++tot] = *aa;
      for (int j = 1; j <= tot; ++j) frg.erase(tmp2[j]);
      frg.insert(make_pair(rr, ll));
    }
  }
  for (int i = 1; i <= N; ++i) printf("%d %lld\n", Ans[i].first, Ans[i].second);
  return 0;
}
