#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int i, j, k, l, m, n, p, t, r, a, b, x, y, z;
  cin >> n >> m;
  vector<long long int> A(n);
  vector<long long int> B(n);
  l = 0;
  for (i = 0; i < n; i++) {
    cin >> A[i];
    l += A[i];
    B[i] = l;
  }
  for (i = 0; i < m; i++) {
    cin >> p;
    k = lower_bound(B.begin(), B.end(), p) - B.begin();
    j = p - (B[k] - A[k]);
    cout << k + 1 << " " << j << "\n";
  }
}
