#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T, class U>
using Pa = pair<T, U>;
template <class T>
using vec = vector<T>;
template <class T>
using vvec = vector<vec<T>>;
template <typename Monoid, typename OperatorMonoid, typename F, typename G,
          typename H>
class LazySegmentTree {
 private:
  int sz, height;
  vec<Monoid> data;
  vec<OperatorMonoid> lazy;
  const F op;
  const G homo;
  const H comp;
  const Monoid e;
  const OperatorMonoid Oe;

 public:
  LazySegmentTree(int n, const F op, const G homo, const H comp,
                  const Monoid &e, const OperatorMonoid Oe)
      : op(op), homo(homo), comp(comp), e(e), Oe(Oe) {
    sz = 1;
    height = 0;
    while (sz <= n) sz <<= 1, height++;
    data.assign(2 * sz, e);
    lazy.assign(2 * sz, Oe);
  }
  void set(int k, const Monoid &x) { data[k + sz] = x; }
  void build() {
    for (int k = sz - 1; k > 0; k--) {
      data[k] = op(data[2 * k], data[2 * k + 1]);
    }
  }
  inline void propagate(int k) {
    if (lazy[k] != Oe) {
      lazy[2 * k] = comp(lazy[2 * k], lazy[k]);
      lazy[2 * k + 1] = comp(lazy[2 * k + 1], lazy[k]);
      data[k] = reflect(k);
      lazy[k] = Oe;
    }
  }
  inline Monoid reflect(int k) {
    return lazy[k] == Oe ? data[k] : homo(data[k], lazy[k]);
  }
  inline void recalc(int k) {
    while (k >>= 1) data[k] = op(reflect(2 * k), reflect(2 * k + 1));
  }
  inline void thrust(int k) {
    for (int i = height; i > 0; i--) propagate(k >> i);
  }
  void update(int a, int b, const OperatorMonoid &x) {
    thrust(a += sz);
    thrust(b += sz - 1);
    for (int l = a, r = b + 1; l < r; l >>= 1, r >>= 1) {
      if (l & 1) lazy[l] = comp(lazy[l], x), ++l;
      if (r & 1) --r, lazy[r] = comp(lazy[r], x);
    }
    recalc(a);
    recalc(b);
  }
  Monoid query(int a, int b) {
    thrust(a += sz);
    thrust(b += sz - 1);
    Monoid L = e, R = e;
    for (int l = a, r = b + 1; l < r; l >>= 1, r >>= 1) {
      if (l & 1) L = op(L, reflect(l++));
      if (r & 1) R = op(reflect(--r), R);
    }
    return op(L, R);
  }
  Monoid operator[](const int &k) { return query(k, k + 1); }
};
template <class T>
class Compress {
 public:
  map<T, int> idx;
  map<int, T> value;
  vector<T> cmp;
  int N;
  Compress(vector<T> v) {
    for (auto &x : v) cmp.push_back(x);
    sort(cmp.begin(), cmp.end());
    cmp.erase(unique(cmp.begin(), cmp.end()), cmp.end());
    N = cmp.size();
    for (int i = 0; i < N; i++) idx[cmp[i]] = i;
  }
  int id(T val) { return idx[val]; }
  T val(int id) { return cmp[id]; }
};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N, M;
  cin >> N >> M;
  vec<ll> X(N), T(N), P(M), B(M);
  for (int i = 0; i < N; i++) cin >> X[i] >> T[i];
  for (int i = 0; i < M; i++) cin >> P[i] >> B[i];
  Compress<ll> cmp(P);
  int m = cmp.N;
  vec<int> idx(N);
  iota(idx.begin(), idx.end(), 0);
  sort(idx.begin(), idx.end(), [&](int i, int j) { return X[i] < X[j]; });
  const ll inf = 1e18;
  auto op1 = [](ll a, ll b) { return min(a, b); };
  auto homo1 = [](ll a, ll b) { return b != inf ? b : a; };
  auto comp1 = homo1;
  struct mosq {
    ll cnt, size;
    bool operator==(const mosq &r) const {
      return cnt == r.cnt && size == r.size;
    }
    bool operator!=(const mosq &r) const {
      return cnt != r.cnt || size != r.size;
    }
  };
  mosq e = {0, 0};
  auto op2 = [](mosq a, mosq b) {
    return (mosq){a.cnt + b.cnt, a.size + b.size};
  };
  auto homo2 = [](mosq a, mosq b) { return b.cnt != inf ? b : a; };
  auto comp2 = homo2;
  LazySegmentTree<ll, ll, decltype(op1), decltype(homo1), decltype(comp1)> flog(
      m, op1, homo1, comp1, inf, inf);
  LazySegmentTree<mosq, mosq, decltype(op2), decltype(homo2), decltype(comp2)>
      mosqs(m, op2, homo2, comp2, e, {inf, inf});
  int a = 0;
  for (auto i : idx) {
    while (a < m && cmp.val(a) < X[i]) a++;
    while (a < m && cmp.val(a) <= X[i] + T[i]) {
      flog.set(a, i);
      a++;
    }
  }
  flog.build();
  vec<ll> ans(N);
  vec<ll> W = cmp.cmp;
  for (int q = 0; q < M; q++) {
    ll p = P[q], b = B[q];
    mosq now = mosqs[cmp.id(p)];
    mosqs.update(cmp.id(p), cmp.id(p) + 1, (mosq){now.cnt + 1, now.size + b});
    ll id = flog[cmp.id(p)];
    if (id == inf) continue;
    while (true) {
      ll r = upper_bound(W.begin(), W.end(), X[id] + T[id]) - W.begin();
      ll l = cmp.id(p);
      flog.update(l, r, id);
      mosq sum = mosqs.query(l, r);
      if (sum.cnt == 0) break;
      ans[id] += sum.cnt;
      T[id] += sum.size;
      mosqs.update(l, r, e);
    }
  }
  for (int i = 0; i < N; i++) cout << ans[i] << " " << T[i] << "\n";
}
