#include <bits/stdc++.h>
int main() {
  long long n, m;
  scanf("%lld%lld", &n, &m);
  long long a[n];
  for (long long i = 0; i < n; i++) {
    scanf("%lld", &a[i]);
  }
  long long sum = 0, x;
  int f = 0, i;
  while (m--) {
    scanf("%lld", &x);
    x -= sum;
    for (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;
}
