#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n = 0, m = 0, k = 0, x = 0, i = 0, L = 0, R = 0, t = 0;
  cin >> n >> m;
  vector<long long> v(n + 1, 0);
  vector<long long> dor(m + 1, 0);
  for (unsigned long long i = 0; i < n; i++) {
    cin >> x;
    v[i] = x;
  }
  for (unsigned long long i = 0; i < m; i++) {
    cin >> x;
    dor[i] = x;
  }
  long long r = 0, l = 0;
  while (i < m) {
    if (dor[i] - r <= v[l]) {
      cout << l + 1 << " " << dor[i] - r << "\n";
      i++;
    } else {
      r += v[l];
      l++;
    }
  }
  return 0;
}
