#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
int n, m, N;
int toOrgIdx[200005];
long long x[200005], t[200005], p[200005], b[200005], num[200005];
vector<pair<pair<int, int>, int> > V;
vector<long long> mos;
set<pair<int, int> > s;
int init[200005];
int dat[530005];
int lb[200005];
inline void update(int a, int b, int val, int v = 1, int l = 1, int r = N) {
  if (a <= l && r <= b)
    dat[v] = min(dat[v], val);
  else if (b < l || r < a)
    return;
  else {
    int m = l + r >> 1;
    update(a, b, val, v << 1, l, m);
    update(a, b, val, v << 1 | 1, m + 1, r);
  }
}
inline int query(int p, int v = 1, int l = 1, int r = N) {
  if (l == r)
    return dat[v];
  else {
    int m = l + r >> 1;
    if (p <= m)
      return min(dat[v], query(p, v << 1, l, m));
    else
      return min(dat[v], query(p, v << 1 | 1, m + 1, r));
  }
}
set<pair<int, int> >::iterator it1, it2;
int Onum[200005], Ot[200005];
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 1; i <= (n); ++i) {
    int x, t;
    cin >> x >> t;
    V.push_back(make_pair(make_pair(x, t), i));
  }
  sort(V.begin(), V.end());
  for (int i = 0; i < n; ++i)
    toOrgIdx[i + 1] = V[i].second, x[i + 1] = V[i].first.first,
                 t[i + 1] = V[i].first.second;
  for (int i = 1; i <= (m); ++i) {
    cin >> p[i] >> b[i];
    mos.push_back(p[i]);
  }
  sort(mos.begin(), mos.end());
  mos.erase(unique(mos.begin(), mos.end()), mos.end());
  N = mos.size();
  for (int i = 0; i < 530000; ++i) dat[i] = INF;
  for (int i = 1; i <= (n); ++i) {
    int l = x[i], r = x[i] + t[i];
    l = lower_bound(mos.begin(), mos.end(), l) - mos.begin() + 1,
    r = upper_bound(mos.begin(), mos.end(), r) - mos.begin();
    if (r >= l) update(l, r, i);
    lb[i] = l;
  }
  for (int q = 1; q <= (m); ++q) {
    int pos = lower_bound(mos.begin(), mos.end(), p[q]) - mos.begin() + 1;
    int i = query(pos);
    if (i == INF)
      s.insert(make_pair(p[q], q));
    else {
      t[i] += b[q];
      ++num[i];
      it1 = s.lower_bound(make_pair(x[i], 0));
      it2 = it1;
      while (it2 != s.end()) {
        if (it2->first > x[i] + t[i])
          break;
        else {
          t[i] += b[it2->second];
          ++num[i];
          ++it2;
        }
      }
      s.erase(it1, it2);
      int r = upper_bound(mos.begin(), mos.end(), x[i] + t[i]) - mos.begin();
      if (r >= lb[i]) update(lb[i], r, i);
    }
  }
  for (int i = 1; i <= (n); ++i)
    Onum[toOrgIdx[i]] = num[i], Ot[toOrgIdx[i]] = t[i];
  for (int i = 1; i <= (n); ++i) cout << Onum[i] << ' ' << Ot[i] << endl;
  return 0;
}
