#include <bits/stdc++.h>
using namespace std;
template <typename... T>
void read(T &...args) {
  ((cin >> args), ...);
}
template <typename... T>
void write(T &&...args) {
  ((cout << args), ...);
}
const int64_t inf = 2e9;
int64_t inp() {
  int64_t x;
  cin >> x;
  return x;
}
string inp_str() {
  string x;
  cin >> x;
  return x;
}
int64_t sqr(int64_t n) { return n * n; }
int64_t power(int64_t a, int64_t b, int64_t mod = inf) {
  int64_t res = 1;
  a %= mod;
  for (int64_t i = b; i > 0; i /= 2) {
    if (i % 2) res = (res * a) % mod;
    a = (a * a) % mod;
  }
  return res;
}
int64_t gcd(int64_t a, int64_t b) {
  while (b > 0) {
    int64_t tmp = a % b;
    a = b;
    b = tmp;
  }
  return a;
}
bool is_pal(string s) { return equal((s).begin(), (s).end(), s.rbegin()); }
void fast_io() {
  ios::sync_with_stdio(0);
  cin.tie(0);
}
void file_io(char *in, char *out) {
  freopen(in, "r", stdin);
  freopen(out, "w", stdout);
}
void print_bool(bool a) {
  if (a)
    cout << "YES\n";
  else
    cout << "NO\n";
}
int64_t n, m;
vector<pair<int64_t, int64_t> > frogs;
vector<pair<int64_t, int64_t> > mos;
const int64_t maxN = 1e6;
int64_t tree[maxN];
vector<int64_t> order;
vector<int64_t> tongue, cnt;
void Input() {
  read(n, m);
  frogs.resize(n + 1);
  for (int64_t i = (1); (n) > (1) ? i <= (n) : i >= (n);
       (n) > (1) ? i += 1 : i -= 1)
    read(frogs[i].first, frogs[i].second);
  mos.resize(m + 1);
  for (int64_t i = (1); (m) > (1) ? i <= (m) : i >= (m);
       (m) > (1) ? i += 1 : i -= 1)
    read(mos[i].first, mos[i].second);
}
bool cmp(int64_t a, int64_t b) { return frogs[a].first < frogs[b].first; }
void buildTree(int64_t p = 1, int64_t b = 1, int64_t e = n) {
  if (b == e)
    tree[p] = frogs[order[b]].second + frogs[order[b]].first;
  else {
    int64_t mid = (b + e) / 2;
    buildTree(2 * p, b, mid);
    buildTree(2 * p + 1, mid + 1, e);
    tree[p] = max(tree[2 * p], tree[2 * p + 1]);
  }
}
void update(int64_t key, int64_t p = 1, int64_t b = 1, int64_t e = n) {
  if (key < b || e < key) return;
  if (b == e)
    tree[p] = frogs[order[key]].second + frogs[order[key]].first;
  else {
    int64_t mid = (b + e) / 2;
    update(key, 2 * p, b, mid);
    update(key, 2 * p + 1, mid + 1, e);
    tree[p] = max(tree[2 * p], tree[2 * p + 1]);
  }
}
int64_t lowestFrog(int64_t pos, int64_t p = 1, int64_t b = 1, int64_t e = n) {
  if (b == e) {
    if (frogs[order[b]].first <= pos &&
        pos <= frogs[order[b]].second + frogs[order[b]].first)
      return order[b];
    else
      return 0;
  }
  int64_t mid = (b + e) / 2;
  if (tree[2 * p] < pos)
    return lowestFrog(pos, 2 * p + 1, mid + 1, e);
  else
    return lowestFrog(pos, 2 * p, b, mid);
}
void Solve() {
  order.resize(n + 1);
  iota((order).begin(), (order).end(), 0);
  sort(1 + (order).begin(), (order).end(), cmp);
  vector<int64_t> pos(n + 1, 0);
  for (int64_t i = (1); (n) > (1) ? i <= (n) : i >= (n);
       (n) > (1) ? i += 1 : i -= 1)
    pos[order[i]] = i;
  buildTree();
  multiset<pair<int64_t, int64_t> > curMos;
  cnt.assign(n + 1, 0);
  for (int64_t i = (1); (m) > (1) ? i <= (m) : i >= (m);
       (m) > (1) ? i += 1 : i -= 1) {
    int64_t j = lowestFrog(mos[i].first);
    if (j > 0) {
      frogs[j].second += mos[i].second;
      cnt[j]++;
      update(pos[j]);
      while (1) {
        auto nearestMos = curMos.lower_bound(make_pair(frogs[j].first, 0ll));
        if (nearestMos == curMos.end() ||
            nearestMos->first > frogs[j].first + frogs[j].second)
          break;
        frogs[j].second += nearestMos->second;
        cnt[j]++;
        curMos.erase(nearestMos);
        update(pos[j]);
      }
    } else
      curMos.insert(mos[i]);
  }
  for (int64_t i = (1); (n) > (1) ? i <= (n) : i >= (n);
       (n) > (1) ? i += 1 : i -= 1)
    write(cnt[i], " ", frogs[i].second, "\n");
}
int main() {
  fast_io();
  Input(), Solve();
  return 0;
}
