#include <bits/stdc++.h>
using namespace std;
int n, m;
tuple<int, int, int> arr[200005];
long long tree[(1 << 19) + 5];
int success;
pair<int, long long> res[200005];
multiset<pair<int, int>> mosquito;
void build_tree(int ini, int fin, int nodo) {
  if (ini == fin) {
    tree[nodo] = get<1>(arr[ini]);
    return;
  }
  int limit = (ini + fin) / 2;
  build_tree(ini, limit, nodo << 1);
  build_tree(limit + 1, fin, nodo << 1 | 1);
  tree[nodo] = max(tree[nodo << 1], tree[nodo << 1 | 1]);
}
void query(int ini, int fin, int nodo, const long long &p, const long long &b) {
  if (ini == fin) {
    if (tree[nodo] >= p && (long long)(get<0>(arr[ini])) <= p) {
      success = ini;
      tree[nodo] += b;
      int pos = get<2>(arr[ini]);
      res[pos] = {res[pos].first + 1, res[pos].second + b};
    }
    return;
  }
  int limit = (ini + fin) / 2;
  if (tree[nodo << 1] >= p)
    query(ini, limit, nodo << 1, p, b);
  else
    query(limit + 1, fin, nodo << 1 | 1, p, b);
  tree[nodo] = max(tree[nodo << 1], tree[nodo << 1 | 1]);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  int x, t;
  for (int i = 0; i < n; ++i) {
    cin >> x >> t;
    res[i].second = t;
    t += x;
    arr[i] = make_tuple(x, t, i);
  }
  sort(arr, arr + n);
  build_tree(0, n - 1, 1);
  int p, b;
  for (int i = 0; i < m; ++i) {
    cin >> p >> b;
    success = -1;
    query(0, n - 1, 1, p, b);
    if (success != -1) {
      auto it = mosquito.lower_bound({get<0>(arr[success]), 0}), it2 = it;
      while (it != mosquito.end()) {
        success = -1;
        query(0, n - 1, 1, (*it).first, (*it).second);
        if (success != -1) {
          ++it;
          mosquito.erase(it2);
          it2 = it;
        } else
          break;
      }
    } else
      mosquito.insert({p, b});
  }
  for (int i = 0; i < n; ++i)
    cout << res[i].first << " " << res[i].second << '\n';
  return 0;
}
