#include <bits/stdc++.h>
using std::isdigit;
using std::lower_bound;
using std::sort;
using std::upper_bound;
template <typename T>
inline void read(T &x) {
  int c = getchar();
  bool f = false;
  for (x = 0; !isdigit(c); c = getchar()) {
    if (c == '-') {
      f = true;
    }
  }
  for (; isdigit(c); c = getchar()) {
    x = x * 10 + c - '0';
  }
  if (f) {
    x = -x;
  }
}
const int MAXN = 200200;
long long a[MAXN], b[MAXN], sum[MAXN];
int n, m, k;
signed main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    read(a[i]);
    sum[i] = sum[i - 1] + a[i];
  }
  for (int i = 1; i <= m; i++) {
    read(b[i]);
    int x = lower_bound(sum + 1, sum + n + 1, b[i]) - sum;
    printf("%d %I64d\n", x, b[i] - sum[x - 1]);
  }
  return 0;
}
