#include <bits/stdc++.h>
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
using namespace std;
template <class T>
using vec = std::vector<T>;
bool __hack = std::ios::sync_with_stdio(false);
auto __hack1 = cin.tie(nullptr);
struct Input {
  Input(istream &in) : in(&in) {}
  template <class T>
  T next() const {
    T x;
    *in >> x;
    return x;
  }
  int ni() const { return next<int>(); }
  istream *in;
};
Input in(cin);
class Output {
 private:
  ostream *out;
  template <typename T>
  void printSingle(const T &value) {
    *out << value;
  }

 public:
  Output(ostream &out) : out(&out) {}
  inline void print() {}
  template <typename T, typename... Ts>
  inline void print(const T &f, const Ts &...args) {
    printSingle(f);
    if (sizeof...(args) != 0) {
      *out << ' ';
      print(args...);
    }
  }
  template <typename... Ts>
  inline void println(const Ts &...args) {
    print(args...);
    (*out) << '\n';
  }
  template <typename... Ts>
  inline void operator()(const Ts &...args) {
    println(args...);
  }
};
Output out(cout);
namespace template_util {
constexpr int bytecount(uint64_t x) { return x ? 1 + bytecount(x >> 8) : 0; }
template <int N>
struct bytetype {};
template <uint64_t N>
struct minimal_uint : bytetype<bytecount(N)> {};
}  // namespace template_util
void solve(istream &inStream, ostream &outStream) {
  in = Input(inStream);
  out = Output(outStream);
  auto n = in.ni();
  auto m = in.ni();
  vec<int64_t> len(n);
  vec<int64_t> originalLen(n);
  vec<int64_t> additionalLen(n);
  vec<int> countEaten(n, 0);
  vec<pair<int, int>> xs(n);
  for (int i = 0; i < (n); ++i) {
    auto x = in.ni();
    len[i] = in.ni();
    xs[i] = {x, i};
  }
  originalLen = len;
  sort(xs.begin(), xs.end());
  vec<pair<int, int>> stack;
  for (int i = n - 1; i >= 0; --i) {
    int x = xs[i].first;
    int x2 = (int)x + (int)len[xs[i].second];
    set<int> ids;
    while (!stack.empty()) {
      if (stack.back().first + len[stack.back().second] <= x2) {
        stack.pop_back();
      } else {
        if (stack.back().first <= x2) {
          int newX = x2 + 1;
          int delta = newX - stack.back().first;
          len[stack.back().second] -= delta;
          stack.back().first = newX;
        }
        break;
      }
    }
    stack.push_back(xs[i]);
  }
  for (int i = 0; i < (stack.size()); ++i) {
    ;
    ;
  }
  set<pair<int64_t, int>> frogs(stack.begin(), stack.end());
  set<pair<int, pair<int, int>>> waitFor;
  while (m--) {
    auto x = in.ni();
    auto sz = in.ni();
    auto it = frogs.lower_bound({x, n});
    if (it == frogs.begin()) {
      continue;
    }
    --it;
    ;
    ;
    auto p = *it;
    frogs.erase(it);
    if (p.first + len[p.second] < x) {
      waitFor.insert({x, {sz, m}});
    } else {
      len[p.second] += sz;
      additionalLen[p.second] += sz;
      countEaten[p.second]++;
      while (true) {
        auto itWait = waitFor.lower_bound({p.first, {-1, -1}});
        if (itWait == waitFor.end()) {
          break;
        }
        if (p.first + len[p.second] < itWait->first) {
          break;
        }
        len[p.second] += itWait->second.first;
        additionalLen[p.second] += itWait->second.first;
        countEaten[p.second]++;
        waitFor.erase(itWait);
      }
      while (true) {
        it = frogs.lower_bound(p);
        if (it == frogs.end()) {
          break;
        }
        if (it->first > p.first + len[p.second]) {
          break;
        }
        if (it->first + len[it->second] <= p.first + len[p.second]) {
          frogs.erase(it);
          continue;
        }
        int64_t newX = p.first + len[p.second] + 1;
        int64_t delta = newX - it->first;
        len[it->second] -= delta;
        auto p2 = *it;
        frogs.erase(it);
        p2.first = newX;
        frogs.insert(p2);
      }
    }
    frogs.insert(p);
  }
  for (int i = 0; i < (n); ++i) {
    out(countEaten[i], originalLen[i] + additionalLen[i]);
  }
}
int main() {
  solve(cin, cout);
  return 0;
}
