#include <bits/stdc++.h>
using namespace std;
const int dr[] = {1, 0, -1, 0, 1, 1, -1, -1};
const int dc[] = {0, 1, 0, -1, 1, -1, 1, -1};
const int inf = 0x3f3f3f3f;
const long long linf = 0x3f3f3f3f3f3f3f3f;
const double PI = acos(-1);
const double EPS = 1e-7;
const long long mod = 1e9 + 7;
const long long mod2 = 1e9 + 9;
long long mypow(long long x, long long y, long long p) {
  long long ret = 1;
  while (y) {
    if (y & 1) ret = (ret * x) % p;
    x = (x * x) % p;
    y /= 2;
  }
  return ret;
}
long long inv(long long x, long long p) { return mypow(x, p - 2, p); }
long long gcd(long long x, long long y) { return y ? gcd(y, x % y) : x; }
const int MAX = 2e5 + 3;
long long N, M, A[MAX], B[MAX], psum[MAX];
int main() {
  scanf("%lld %lld", &N, &M);
  for (int i = 1; i <= N; i++) {
    scanf("%lld", A + i);
    psum[i] = psum[i - 1] + A[i];
  }
  for (int i = 1; i <= M; i++) {
    scanf("%lld", B + i);
  }
  for (int i = 1; i <= M; i++) {
    int idx = lower_bound(psum + 1, psum + N + 1, B[i]) - psum;
    printf("%d %lld\n", idx, B[i] - psum[idx - 1]);
  }
  return 0;
}
