#include <bits/stdc++.h>
using namespace std;
const int MAXN = 300000;
const int MOD = 1000000007;
const int INF = 1000000010;
const long double EPS = 1e-6;
int N, M;
long long int X[MAXN], T[MAXN];
int c[MAXN] = {0};
int id[MAXN];
multiset<pair<long long int, long long int>> mq;
long long int t[4 * MAXN];
void build_tree(int v = 0, int l = 0, int r = N - 1) {
  if (l == r) {
    t[v] = X[id[l]] + T[id[l]];
  } else {
    build_tree(2 * v + 1, l, (l + r) / 2);
    build_tree(2 * v + 2, (l + r) / 2 + 1, r);
    t[v] = max(t[2 * v + 1], t[2 * v + 2]);
  }
}
void update(int p, long long int val, int v = 0, int l = 0, int r = N - 1) {
  if (l == p && r == p) {
    t[v] = val;
  } else {
    if (p <= (l + r) / 2)
      update(p, val, 2 * v + 1, l, (l + r) / 2);
    else
      update(p, val, 2 * v + 2, (l + r) / 2 + 1, r);
    t[v] = max(t[2 * v + 1], t[2 * v + 2]);
  }
}
int get_pos(long long int val, int v = 0, int l = 0, int r = N - 1) {
  if (t[v] < val) return N;
  if (l == r) return l;
  int res = get_pos(val, 2 * v + 1, l, (l + r) / 2);
  if (res == N) res = get_pos(val, 2 * v + 2, (l + r) / 2 + 1, r);
  return res;
}
bool cmp(int id1, int id2) { return X[id1] < X[id2]; }
int main() {
  scanf("%d %d", &N, &M);
  for (int i = 0; i < N; i++) {
    scanf("%I64d %I64d", &X[i], &T[i]);
    id[i] = i;
  }
  sort(id, id + N, cmp);
  X[N] = INF;
  id[N] = N;
  build_tree();
  long long int p, b;
  int ptr;
  multiset<pair<long long int, long long int>>::iterator it;
  for (int i = 0; i < M; i++) {
    scanf("%I64d %I64d", &p, &b);
    ptr = get_pos(p);
    if (X[id[ptr]] > p) {
      mq.insert(make_pair(p, b));
    } else {
      T[id[ptr]] += b;
      c[id[ptr]]++;
      while (true) {
        it = mq.lower_bound(make_pair(X[id[ptr]], 0));
        if (it == mq.end() || it->first > X[id[ptr]] + T[id[ptr]]) break;
        T[id[ptr]] += it->second;
        c[id[ptr]]++;
        mq.erase(it);
      }
      update(ptr, X[id[ptr]] + T[id[ptr]]);
    }
  }
  for (int i = 0; i < N; i++) {
    printf("%d %I64d\n", c[i], T[i]);
  }
  return 0;
}
