#include <bits/stdc++.h>
using namespace std;
long long tree[200009];
inline void update(int x, long long val, int n) {
  while (x <= n) {
    tree[x] = max(tree[x], val);
    x = x + (x & (-x));
  }
}
inline long long query(int x) {
  long long sum = 0;
  while (x > 0) {
    sum = max(sum, tree[x]);
    x = x - (x & (-x));
  }
  return sum;
}
inline bool check(int mid, long long x) {
  long long ans = query(mid);
  if (ans >= x) {
    return true;
  }
  return false;
}
int res[200009];
pair<int, long long> fans[200009];
int main() {
  int n, m;
  scanf("%d", &n);
  scanf("%d", &m);
  pair<long long, long long> a[n + 1];
  vector<pair<long long, int> > vv;
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &a[i].first);
    scanf("%lld", &a[i].second);
    vv.push_back(make_pair(a[i].first, i));
  }
  sort(vv.begin(), vv.end());
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) {
    update(i, a[i].second + a[i].first, n);
    a[i].second = a[i].second + a[i].first;
  }
  vector<long long> v;
  for (int i = 0; i < n; i++) {
    v.push_back(a[i + 1].first);
  }
  multiset<pair<long long, long long> > s;
  for (int i = 0; i < m; i++) {
    long long x;
    scanf("%lld", &x);
    long long y;
    scanf("%lld", &y);
    auto it = lower_bound(v.begin(), v.end(), x + 1);
    int low = 1, high;
    if (it == v.end()) {
      high = n;
    } else {
      int u = it - v.begin();
      high = u;
    }
    if (high == 0) {
      continue;
    }
    if (check(high, x)) {
    } else {
      s.insert(make_pair(x, y));
      continue;
    }
    while (low < high) {
      int mid = low + ((high - low) / 2);
      if (check(mid, x)) {
        high = mid;
      } else {
        low = mid + 1;
      }
    }
    long long ans = a[low].second;
    ans = ans + y;
    res[low]++;
    auto it1 = s.lower_bound(make_pair(a[low].first, -1ll));
    auto it2 = it1;
    while (it2 != s.end()) {
      if ((it2->first) <= ans) {
        res[low]++;
        ans = ans + (it2->second);
        it2++;
      } else {
        break;
      }
    }
    a[low].second = ans;
    update(low, ans, n);
    if (it2 == s.end()) {
      auto it3 = it1;
      while (it1 != s.end()) {
        it3 = it1;
        it3++;
        s.erase(it1);
        it1 = it3;
      }
    } else {
      auto it3 = it1;
      while (it1 != it2) {
        it3 = it1;
        it3++;
        s.erase(it1);
        it1 = it3;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    fans[vv[i - 1].second] = make_pair(res[i], a[i].second - a[i].first);
  }
  for (int i = 1; i <= n; i++) {
    printf("%d %lld\n", fans[i].first, fans[i].second);
  }
}
