#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
long long n, m, x[N], len[N], ind, a[N], w[N], k[N];
pair<long long, long long> f[N];
set<pair<long long, long long> > q, cur;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> x[i] >> len[i];
    f[i] = make_pair(x[i], i);
  }
  sort(f + 1, f + n + 1);
  for (int i = 1; i <= n; i++) {
    int ind = f[i].second;
    if (q.empty() || x[ind] + len[ind] > q.rbegin()->first) {
      q.insert(make_pair(x[ind] + len[ind], ind));
    }
  }
  for (int i = 1; i <= m; i++) {
    cin >> a[i] >> w[i];
    auto it = q.lower_bound(make_pair(a[i], 0));
    int ind = it->second;
    if (it != q.end() && x[ind] <= a[i]) {
      q.erase(make_pair(len[ind] + x[ind], ind));
      while (true) {
        auto v = q.lower_bound(make_pair(len[ind] + x[ind], 0));
        if (v == q.end() || v->first > len[ind] + x[ind] + w[i]) {
          break;
        } else {
          q.erase(v);
        }
      }
      len[ind] += w[i];
      k[ind]++;
      q.insert(make_pair(len[ind] + x[ind], ind));
      while (true) {
        auto v = cur.lower_bound(make_pair(x[ind], 0));
        if (v == cur.end() || v->first > len[ind] + x[ind]) {
          break;
        }
        int ind1 = v->second;
        cur.erase(v);
        q.erase(make_pair(len[ind] + x[ind], ind));
        while (true) {
          auto r = q.lower_bound(make_pair(len[ind] + x[ind], 0));
          if (r == q.end() || r->first > len[ind] + x[ind] + w[ind1]) {
            break;
          } else {
            q.erase(r);
          }
        }
        len[ind] += w[ind1];
        k[ind]++;
        q.insert(make_pair(len[ind] + x[ind], ind));
      }
    } else {
      cur.insert(make_pair(a[i], i));
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << k[i] << " " << len[i] << "\n";
  }
}
