#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, i, s = 0, j = 0;
  cin >> n >> m;
  long long a[n];
  long long b[m];
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < m; i++) {
    cin >> b[i];
    while ((s + a[j]) < b[i]) {
      s = s + a[j];
      j++;
    }
    cout << j + 1 << " " << b[i] - s << endl;
  }
  return 0;
}
