#include <bits/stdc++.h>
int main() {
  long long int n, m, s = 0;
  int t = 0;
  scanf("%lld %lld", &n, &m);
  long long int a[n];
  long long int b[m];
  for (int i = 0; i < n; i++) {
    scanf("%lld", &a[i]);
  }
  for (int i = 0; i < m; i++) {
    scanf("%lld", &b[i]);
  }
  for (int i = 0; i < m;) {
    if (b[i] <= s + a[t]) {
      printf("%d %lld\n", t + 1, b[i] - s);
      i++;
    } else {
      t++;
      s += a[t - 1];
    }
  }
  return 0;
}
