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