#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  long long rooms[n];
  long long letters[m];
  vector<long long> f(m);
  vector<long long> k(m);
  for (int i = 0; i < n; i++) {
    cin >> rooms[i];
    if (i != 0) rooms[i] += rooms[i - 1];
  }
  for (int i = 0; i < m; i++) {
    cin >> letters[i];
  }
  for (int i = 0; i < m; i++) {
    long long k = letters[i];
    int lo = 0, hi = n - 1;
    while (lo < hi) {
      int mid = lo + (hi - lo) / 2;
      if (rooms[mid] >= k) {
        hi = mid;
      } else {
        lo = mid + 1;
      }
    }
    f[i] = lo + 1;
  }
  for (int i = 0; i < m; i++) {
    if (f[i] == 1) {
      k[i] = letters[i];
      continue;
    }
    k[i] = letters[i] - rooms[f[i] - 2];
  }
  for (int i = 0; i < m; i++) cout << f[i] << " " << k[i] << "\n";
  return 0;
}
