#include <bits/stdc++.h>
using namespace std;
inline int max(int a, int b) { return a < b ? b : a; }
inline int min(int a, int b) { return a > b ? b : a; }
inline long long max(long long a, long long b) { return a < b ? b : a; }
inline long long min(long long a, long long b) { return a > b ? b : a; }
const int mod = 1e9 + 7;
const int N = 1e6 + 10;
const long long INF = 1e18;
int tree[6 * N], lazy[6 * N], ce[6 * N];
pair<long long, long long> ans[N];
pair<long long, long long> mos[N];
pair<pair<long long, long long>, int> fr[N];
vector<long long> pos;
void upd(int C, int S, int E, int s, int e, int v) {
  if (lazy[C]) {
    if (tree[C] == 0) tree[C] = lazy[C];
    tree[C] = min(lazy[C], tree[C]);
    if (lazy[C * 2] == 0) lazy[C * 2] = lazy[C];
    if (lazy[C * 2 + 1] == 0) lazy[C * 2 + 1] = lazy[C];
    lazy[C * 2 + 1] = min(lazy[C * 2 + 1], lazy[C]);
    lazy[C * 2] = min(lazy[C * 2], lazy[C]);
    lazy[C] = 0;
  }
  if (s > E || e < S) return;
  if (s <= S && E <= e) {
    if (tree[C] == 0) tree[C] = v;
    tree[C] = min(tree[C], v);
    if (lazy[C] == 0) lazy[C] = v;
    lazy[C] = min(v, lazy[C]);
    return;
  }
  int m = (S + E) >> 1;
  upd(C * 2, S, m, s, e, v);
  upd(C * 2 + 1, m + 1, E, s, e, v);
  tree[C] = max(tree[C * 2], tree[C * 2 + 1]);
}
int q(int C, int S, int E, int v) {
  if (lazy[C]) {
    if (tree[C] == 0) tree[C] = lazy[C];
    tree[C] = min(lazy[C], tree[C]);
    lazy[C * 2] = lazy[C * 2 + 1] = lazy[C];
    lazy[C] = 0;
  }
  if (ce[C] <= v) return -1;
  if (S == E) return S;
  int m = (S + E) >> 1;
  int x = q(C * 2, S, m, v);
  if (x == -1)
    return q(C * 2 + 1, m + 1, E, v);
  else
    return x;
}
int q2(int C, int S, int E, int s) {
  if (lazy[C]) {
    if (tree[C] == 0) tree[C] = lazy[C];
    tree[C] = min(lazy[C], tree[C]);
    if (lazy[C * 2] == 0) lazy[C * 2] = lazy[C];
    if (lazy[C * 2 + 1] == 0) lazy[C * 2 + 1] = lazy[C];
    lazy[C * 2 + 1] = min(lazy[C * 2 + 1], lazy[C]);
    lazy[C * 2] = min(lazy[C * 2], lazy[C]);
    lazy[C] = 0;
  }
  if (s > E || s < S) return 0;
  if (S == E) return tree[C];
  int m = (S + E) >> 1;
  return max(q2(C * 2, S, m, s), q2(C * 2 + 1, m + 1, E, s));
}
map<long long, pair<long long, long long> > M;
vector<long long> pd;
pair<long long, long long> ze[N];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; ++i) {
    long long x, y;
    scanf("%lld%lld", &x, &y);
    pos.push_back(x);
    fr[i].first = make_pair(x, y);
    fr[i].second = i;
  }
  for (int i = 0; i < 6 * N; ++i) ce[i] = mod;
  sort(fr, fr + n);
  for (int i = 0; i < m; ++i) {
    long long x, y;
    scanf("%lld%lld", &x, &y);
    mos[i] = make_pair(x, y);
    pos.push_back(x);
  }
  sort(pos.begin(), pos.end());
  pos.resize(unique(pos.begin(), pos.end()) - pos.begin());
  int tot = pos.size();
  for (int i = n - 1; i >= 0; i--) {
    int b = lower_bound(pos.begin(), pos.end(), fr[i].first.first) -
            pos.begin(),
        e = lower_bound(pos.begin(), pos.end(),
                        fr[i].first.first + fr[i].first.second) -
            pos.begin();
    ans[i].first = fr[i].first.second;
    if (e < pos.size() && pos[e] > fr[i].first.first + fr[i].first.second) e--;
    if (b <= e) upd(1, 0, tot, b, e, i + 1);
  }
  for (int i = 0; i < m; ++i) {
    int b = lower_bound(pos.begin(), pos.end(), mos[i].first) - pos.begin();
    int as = q2(1, 0, tot, b);
    if (as == 0) {
      M[mos[i].first].first++;
      M[mos[i].first].second += mos[i].second;
    } else {
      int b = lower_bound(pos.begin(), pos.end(), fr[as - 1].first.first) -
              pos.begin();
      pd.clear();
      ans[as - 1].second++;
      long long cur = ans[as - 1].first + mos[i].second;
      map<long long, pair<long long, long long> >::iterator it1 =
          M.lower_bound(fr[as - 1].first.first);
      while (it1 != M.end() && it1->first <= fr[as - 1].first.first + cur) {
        ans[as - 1].second += it1->second.first;
        cur += it1->second.second;
        pd.push_back(it1->first);
        it1++;
      }
      ans[as - 1].first = cur;
      for (int j = 0; j < pd.size(); ++j) M.erase(pd[j]);
      int e =
          lower_bound(pos.begin(), pos.end(), fr[as - 1].first.first + cur) -
          pos.begin();
      if (e < pos.size() && pos[e] > fr[as - 1].first.first + cur) e--;
      if (b != -1 && b <= e) upd(1, 0, tot, b, e, as);
    }
  }
  for (int i = 0; i < n; ++i) ze[fr[i].second] = ans[i];
  for (int i = 0; i < n; ++i) printf("%lld %lld\n", ze[i].second, ze[i].first);
  return 0;
}
