#include <bits/stdc++.h>
using namespace std;
const int N = 200001;
const long long MOD = 1e9 + 7;
int n, m;
long long a[N], b[N];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%lld", a + i);
  for (int i = 0; i < m; i++) scanf("%lld", b + i);
  int f = 0;
  long long pre = 0;
  for (int i = 0; i < m; i++) {
    while (f < n && pre + a[f] < b[i]) pre += a[f++];
    b[i] -= pre;
    printf("%d %lld\n", f + 1, b[i]);
  }
  return 0;
}
