#include <bits/stdc++.h>
long long i, j, a[200860], b[200860], s1[200860], s2[200860];
int main() {
  int n, m;
  while (~scanf("%d%d", &n, &m)) {
    a[0] = 0;
    for (i = 1; i <= n; i++) {
      long long t;
      scanf("%lld", &t);
      a[i] = a[i - 1] + t;
    }
    int k = 1;
    for (i = 1; i <= m; i++) {
      scanf("%lld", &b[i]);
      for (j = k; j <= n; j++) {
        if (b[i] <= a[j]) {
          k = j;
          s1[i] = j;
          s2[i] = b[i] - a[j - 1];
          break;
        }
      }
    }
    for (i = 1; i <= m; i++) printf("%lld %lld\n", s1[i], s2[i]);
  }
}
