#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, n = 0, m = 0;
  cin >> N >> n;
  long long a[N + 1];
  cin >> a[1];
  for (int k = 2; k <= N; k++) {
    cin >> a[k];
    a[k] += a[k - 1];
  }
  a[0] = 0;
  for (int k = 1; k <= n; k++) {
    long long x;
    cin >> x;
    int l = 0, r = N;
    while (l < r) {
      m = l + (r - l) / 2;
      if (x > a[m])
        l = m + 1;
      else
        r = m;
    }
    cout << r << ' ' << x - a[r - 1] << endl;
  }
  return 0;
}
