#include <bits/stdc++.h>
using namespace std;
using LL = int64_t;
using pii = pair<int, int>;
const double PI = 2 * asin(1);
vector<LL> val;
template <class T>
struct Seg_tree {
  vector<T> date;
  void initial(int n) { date.clear(), date.resize(n << 2); }
  inline int ls(int root) { return root << 1; }
  inline int rs(int root) { return (root << 1) | 1; }
  void push_up(int root) { date[root] = max(date[ls(root)], date[rs(root)]); }
  void built(int root, int l, int r) {
    if (l == r) {
      date[root] = val[l];
      return;
    }
    int md = (l + r) >> 1;
    built(ls(root), l, md);
    built(rs(root), md + 1, r);
    push_up(root);
  }
  void update_pt(int root, int l, int r, int p, T k) {
    if (l == p && p == r) {
      date[root] += k;
      return;
    }
    int md = (l + r) >> 1;
    if (p <= md) update_pt(ls(root), l, md, p, k);
    if (p > md) update_pt(rs(root), md + 1, r, p, k);
    push_up(root);
  }
  T query(int root, int l, int r, int u, int v) {
    if (u <= l && v >= r) return date[root];
    int md = (l + r) >> 1;
    if (v <= md) return query(ls(root), l, md, u, v);
    if (u > md) return query(rs(root), md + 1, r, u, v);
    return max(query(ls(root), l, md, u, v), query(rs(root), md + 1, r, u, v));
  }
};
struct Frog {
  int x, t, id, cnt;
  Frog(int x = 0, int t = 0, int id = 0, int cnt = 0)
      : x(x), t(t), id(id), cnt(cnt) {}
};
bool cmp_x(Frog &f1, Frog &f2) { return f1.x < f2.x; }
bool cmp_id(Frog &f1, Frog &f2) { return f1.id < f2.id; }
int g_n, g_m;
Seg_tree<LL> tr;
vector<Frog> vf;
vector<LL> vll_frog;
multimap<LL, LL> mm_mos;
void pretreat() {}
void input() {
  val.clear(), val.resize(g_n << 2);
  tr.initial(g_n);
  tr.built(1, 1, g_n);
  vf.clear();
  for (int i = 0, x, t; i < g_n; ++i) {
    scanf(" %d %d", &x, &t);
    vf.emplace_back(x, t, i);
  }
  sort(vf.begin(), vf.end(), cmp_x);
  vll_frog.clear();
  for (int i = 0; i < g_n; ++i) {
    vll_frog.emplace_back(vf[i].x);
    tr.update_pt(1, 1, g_n, i + 1, vf[i].x + vf[i].t);
  }
  mm_mos.clear();
}
void solve() {
  LL p, b;
  while (g_m--) {
    cin >> p >> b;
    auto it = upper_bound(vll_frog.begin(), vll_frog.end(), p);
    int pos = 0, l = 1, r = it - vll_frog.begin();
    while (r - l > 3) {
      int md = (l + r) >> 1;
      if (tr.query(1, 1, g_n, l, md) >= p) {
        r = md;
      } else if (tr.query(1, 1, g_n, md, r) >= p) {
        l = md;
      } else {
        pos = -1;
        break;
      }
    }
    if (pos > -1) {
      for (int i = l; i <= r; ++i) {
        if (tr.query(1, 1, g_n, i, i) >= p) {
          pos = i;
          break;
        }
      }
    }
    if (pos > 0) {
      tr.update_pt(1, 1, g_n, pos, b);
      --pos;
      vf[pos].t += b;
      ++vf[pos].cnt;
      while (!mm_mos.empty()) {
        auto nit = mm_mos.lower_bound(vf[pos].x);
        if (nit == mm_mos.end() || vf[pos].x + vf[pos].t < nit->first) break;
        vf[pos].t += nit->second;
        ++vf[pos].cnt;
        tr.update_pt(1, 1, g_n, pos + 1, nit->second);
        mm_mos.erase(nit);
      }
    } else {
      mm_mos.emplace(p, b);
    }
  }
  sort(vf.begin(), vf.end(), cmp_id);
  for (Frog &f : vf) {
    printf("%d %d\n", f.cnt, f.t);
  }
}
int main() {
  pretreat();
  while (cin >> g_n >> g_m) {
    input();
    solve();
  }
  return 0;
}
