#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, m;
  cin >> n >> m;
  long long dom[n], pre[n], letter[m];
  for (long long i = 0; i < n; i++) {
    cin >> dom[i];
  }
  for (long long i = 0; i < m; i++) {
    cin >> letter[i];
  }
  for (long long i = 0; i < n; i++) {
    pre[i] = 0;
  }
  pre[0] = dom[0];
  for (long long i = 1; i < n; i++) {
    pre[i] = pre[i - 1] + dom[i];
  }
  for (long long i = 0; i < m; i++) {
    long long l = 0, r = n - 1, ans = -1;
    while (l <= r) {
      long long mid = l + (r - l) / 2;
      if (pre[mid] >= letter[i]) {
        ans = mid + 1;
        r = mid - 1;
      } else {
        l = mid + 1;
      }
    }
    long long num;
    if (ans > 1)
      num = letter[i] - pre[ans - 2];
    else
      num = letter[i];
    cout << ans << " " << num << "\n";
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
