#include <bits/stdc++.h>
int main() {
  std::ios::sync_with_stdio(false);
  using namespace std;
  long long n, m, tmp;
  cin >> n >> m;
  vector<long long> A(n + 1, 0);
  for (int i = 0; i < n; i++) {
    cin >> tmp;
    A[i + 1] = A[i] + tmp;
  }
  for (int i = 0; i < m; i++) {
    cin >> tmp;
    auto it = lower_bound(A.begin(), A.end(), tmp);
    it--;
    cout << distance(A.begin(), it) + 1 << " " << tmp - *it << "\n";
  }
  return 0;
}
