#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long x, b = 0, c = a[0], j = 0;
  for (long long i = 0; i < m; i++) {
    cin >> x;
  l1:
    if (x <= c && x > b) {
      cout << j + 1 << " " << x - b << endl;
    } else {
      b += a[j];
      j += 1;
      c += a[j];
      goto l1;
    }
  }
}
