#include <bits/stdc++.h>
using namespace std;
long long n, m, A[200005], cs[200005], ltr, l, r, mid, ans;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> A[i];
  }
  for (int i = 1; i <= n; i++) {
    cs[i] = cs[i - 1] + A[i - 1];
  }
  while (m--) {
    cin >> ltr;
    l = 1, r = n, ans = 0;
    long long dorm, room;
    while (l <= r) {
      mid = (r + l) / 2;
      if (ltr <= cs[mid]) {
        dorm = mid;
        r = mid - 1;
      } else {
        l = mid + 1;
      }
    }
    room = ltr - cs[dorm - 1];
    cout << dorm << " " << room << "\n";
  }
}
