#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair<ll, ll>;
const ll maxn = 2e5 + 10;
struct Frog {
  ll idx, x, tong_len, cnt = 0;
  bool operator<(const Frog &rhs) const { return x < rhs.x; }
} f[maxn], ans[maxn];
struct Mosq {
  ll x, sz;
  Mosq() {}
  Mosq(ll _x, ll _sz) : x(_x), sz(_sz) {}
  bool operator<(const Mosq &rhs) const {
    if (x == rhs.x) return sz < rhs.sz;
    return x < rhs.x;
  }
};
struct Node {
  ll leftmost_x, rightmost_to;
  Node *left, *right;
  Node() {}
  Node(ll _x, ll _to, Node *_left = nullptr, Node *_right = nullptr)
      : leftmost_x(_x), rightmost_to(_to), left(_left), right(_right) {}
} *root = new Node();
void pull(Node *u) {
  Node *l = u->left, *r = u->right;
  u->leftmost_x = min(l->leftmost_x, r->leftmost_x);
  u->rightmost_to = max(l->rightmost_to, r->rightmost_to);
}
void build(Node *u, ll l, ll r) {
  if (l == r) {
    u->leftmost_x = f[l].x;
    u->rightmost_to = f[l].x + f[l].tong_len;
    return;
  }
  ll mid = (l + r) >> 1;
  u->left = new Node();
  build(u->left, l, mid);
  u->right = new Node;
  build(u->right, mid + 1, r);
  pull(u);
}
multiset<Mosq> s;
bool query_and_modify(Node *u, ll l, ll r, Mosq mos) {
  if (l == r) {
    if (u->leftmost_x <= mos.x && mos.x <= u->rightmost_to) {
      u->rightmost_to += mos.sz;
      ans[f[l].idx].tong_len += mos.sz;
      ans[f[l].idx].cnt++;
      Mosq sea(u->leftmost_x, 0);
      auto it = s.lower_bound(sea);
      while (it != s.end() && it->x <= u->rightmost_to) {
        u->rightmost_to += it->sz;
        ans[f[l].idx].tong_len += it->sz;
        ans[f[l].idx].cnt++;
        s.erase(it);
        it = s.lower_bound(sea);
      }
      return true;
    } else
      return false;
  }
  ll mid = (l + r) >> 1;
  if (u->left->leftmost_x <= mos.x && mos.x <= u->left->rightmost_to) {
    bool modified = query_and_modify(u->left, l, mid, mos);
    if (modified) {
      pull(u);
      return true;
    }
  } else if (u->right->leftmost_x <= mos.x && mos.x <= u->right->rightmost_to) {
    bool modified = query_and_modify(u->right, mid + 1, r, mos);
    if (modified) {
      pull(u);
      return true;
    }
  }
  return false;
}
void solve() {
  ll n, m;
  cin >> n >> m;
  for (ll i = 0; i < n; i++) {
    cin >> f[i].x >> f[i].tong_len;
    f[i].idx = i;
    ans[i] = f[i];
  }
  sort(f, f + n);
  build(root, 0, n - 1);
  for (ll i = 0; i < m; i++) {
    Mosq mos;
    cin >> mos.x >> mos.sz;
    bool modified = query_and_modify(root, 0, n - 1, mos);
    if (!modified) s.insert(mos);
  }
  for (ll i = 0; i < n; i++) {
    cout << ans[i].cnt << ' ' << ans[i].tong_len << '\n';
  }
}
signed main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  solve();
}
