#include <bits/stdc++.h>
using namespace std;
long long a[200005];
int main() {
  long long n, m;
  while (~scanf("%lld%lld", &n, &m)) {
    for (int i = 0; i < n; i++) scanf("%lld", &a[i]);
    long long sum = 0, x;
    int f = 0;
    while (m--) {
      scanf("%lld", &x);
      x -= sum;
      for (int i = f; i < n; i++) {
        if (x - a[i] > 0) {
          x -= a[i];
          sum += a[i];
        } else {
          printf("%d %lld\n", i + 1, x);
          f = i;
          break;
        }
      }
    }
  }
  return 0;
}
