#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, i, j, t = 0;
  vector<pair<long long, long long> > ans;
  cin >> n >> m;
  long long a[n], aa[n];
  for (i = 0; i < n; ++i) cin >> a[i];
  aa[0] = a[0];
  for (i = 1; i < n; ++i) aa[i] = aa[i - 1] + a[i];
  for (i = 0; i < m; ++i) {
    cin >> t;
    long long l = 0, r = n - 1;
    while (r - l > 1) {
      long long m = (l + r) / 2;
      if (aa[m] > t)
        r = m;
      else
        l = m;
    }
    if (aa[l] < t) l = r;
    if (l > 0)
      ans.push_back(make_pair(-aa[l - 1] + t, l + 1));
    else
      ans.push_back(make_pair(t, l + 1));
  }
  for (i = 0; i < ans.size(); ++i)
    cout << ans[i].second << " " << ans[i].first << endl;
  return 0;
}
