#include <bits/stdc++.h>
using namespace std;
const int MAXN = 512345;
const int INFTY = 0x3f3f3f3f;
int n, m;
int frog_position[MAXN], mosquito_position[MAXN];
int mosquito_size[MAXN];
int frog_counter[MAXN];
long long frog_size[MAXN];
map<int, int> x_to_index;
map<int, int> index_to_x;
map<int, int> x_to_frog_index;
set<int> all_x;
vector<int> all_x_list;
int total;
void print_maps() {
  map<int, int>::iterator it;
  printf("x_to_index: {");
  for (it = x_to_index.begin(); it != x_to_index.end(); it++) {
    printf("%d -> %d, ", it->first, it->second);
  }
  printf("}\nindex_to_x: {");
  for (it = index_to_x.begin(); it != index_to_x.end(); it++) {
    printf("%d -> %d, ", it->first, it->second);
  }
  printf("}\nx_to_frog_index: {");
  for (it = x_to_frog_index.begin(); it != x_to_frog_index.end(); it++) {
    printf("%d -> %d, ", it->first, it->second);
  }
  printf("}\nall_x: {");
  for (set<int>::iterator it2 = all_x.begin(); it2 != all_x.end(); it2++) {
    printf("%d, ", *it2);
  }
  printf("}\n\n\n");
  printf("total = %d\n", total);
}
void print_answer() {
  for (int i = 1; i <= n; i++) {
    printf("%d %I64d\n", frog_counter[i], frog_size[i]);
  }
}
void compress_coordinates() {
  for (int i = 1; i <= n; i++) {
    all_x.insert(frog_position[i]);
    x_to_frog_index[frog_position[i]] = i;
  }
  for (int i = 1; i <= m; i++) all_x.insert(mosquito_position[i]);
  total = 1;
  all_x_list.push_back(-INFTY);
  for (set<int>::iterator it = all_x.begin(); it != all_x.end(); it++) {
    x_to_index[*it] = total;
    index_to_x[total] = *it;
    all_x_list.push_back(*it);
    total += 1;
  }
  total -= 1;
}
int find_upper_bound(long long x) {
  if (x >= 1LL * INFTY) return total + 1;
  int x_int = x;
  return upper_bound(all_x_list.begin(), all_x_list.end(), x_int) -
         all_x_list.begin();
}
int tree[4 * MAXN];
void build(int idx, int left, int right) {
  tree[idx] = INFTY;
  if (left == right) {
    return;
  } else {
    int mid = (left + right) / 2;
    build(2 * idx, left, mid);
    build(2 * idx + 1, mid + 1, right);
  }
}
void update(int idx, int left, int right, int seg_left, int seg_right, int x) {
  if (seg_left > seg_right) return;
  if (seg_left > right || seg_right < left) return;
  if (seg_left <= left && right <= seg_right) {
    tree[idx] = min(tree[idx], x);
    return;
  } else {
    int mid = (left + right) / 2;
    update(2 * idx, left, mid, seg_left, seg_right, x);
    update(2 * idx + 1, mid + 1, right, seg_left, seg_right, x);
  }
}
int query(int idx, int left, int right, int x) {
  if (left == right)
    return tree[idx];
  else {
    int mid = (left + right) / 2;
    if (x <= mid) {
      return min(tree[idx], query(2 * idx, left, mid, x));
    } else {
      return min(tree[idx], query(2 * idx + 1, mid + 1, right, x));
    }
  }
}
multiset<pair<int, int> > waiting_mosquitoes;
void add_frogs() {
  build(1, 1, total);
  for (int i = 1; i <= n; i++) {
    int x = frog_position[i];
    int seg_left = x_to_index[x];
    int seg_right = find_upper_bound(frog_size[i] + x) - 1;
    update(1, 1, total, seg_left, seg_right, x);
  }
}
void update_frog(int frog_index, int mosquito_size);
void process_previous_mosquitoes(int frog_index) {
  int x_frog = frog_position[frog_index];
  long long end_frog = frog_size[frog_index] + x_frog;
  set<pair<int, int> >::iterator it =
      waiting_mosquitoes.lower_bound(make_pair(x_frog, -INFTY));
  if (it != waiting_mosquitoes.end() && 1LL * (*it).first <= end_frog) {
    pair<int, int> eaten_mosquito = make_pair(it->first, it->second);
    waiting_mosquitoes.erase(it);
    update_frog(frog_index, eaten_mosquito.second);
  }
}
void update_frog(int frog_index, int mosquito_size) {
  int x_frog = frog_position[frog_index];
  long long old_size = frog_size[frog_index];
  long long new_size = old_size + mosquito_size;
  int seg_left = find_upper_bound(old_size + x_frog);
  int seg_right = find_upper_bound(new_size + x_frog) - 1;
  update(1, 1, total, seg_left, seg_right, x_frog);
  frog_size[frog_index] = new_size;
  frog_counter[frog_index] += 1;
  process_previous_mosquitoes(frog_index);
}
void add_new_mosquito(int pos, int mosquito_size) {
  int x_frog = query(1, 1, total, x_to_index[pos]);
  if (x_frog >= INFTY) {
    waiting_mosquitoes.insert(make_pair(pos, mosquito_size));
  } else {
    int frog_index = x_to_frog_index[x_frog];
    update_frog(frog_index, mosquito_size);
  }
}
void solve() {
  compress_coordinates();
  add_frogs();
  for (int i = 1; i <= m; i++) {
    add_new_mosquito(mosquito_position[i], mosquito_size[i]);
  }
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d %I64d", &frog_position[i], &frog_size[i]);
  }
  for (int i = 1; i <= m; i++) {
    scanf("%d %d", &mosquito_position[i], &mosquito_size[i]);
  }
  solve();
  print_answer();
  return 0;
}
