#include <bits/stdc++.h>
using namespace std;
long long n, m, a[200001], x;
int fn(int g) {
  int l = 0, r = n, mid;
  while (l < r) {
    mid = (l + r + 1) / 2;
    if (a[mid] < x)
      l = mid;
    else
      r = mid - 1;
  }
  return l;
}
int main() {
  cin >> n >> m;
  a[0] = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (i == 1) continue;
    a[i] += a[i - 1];
  }
  for (int i = 1; i <= m; i++) {
    cin >> x;
    int z = fn(x);
    cout << z + 1 << " " << x - a[z] << endl;
  }
}
