#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, left, right, mid, ans;
  unsigned long long int x;
  cin >> n >> m;
  vector<unsigned long long int> a(n + 1);
  a[0] = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    a[i] += a[i - 1];
  }
  while (m--) {
    cin >> x;
    left = 1, right = n;
    while (left <= right) {
      mid = (left + right) / 2;
      if (x <= a[mid]) {
        ans = mid;
        right = mid - 1;
      } else {
        left = mid + 1;
      }
    }
    cout << ans << " " << x - a[ans - 1] << "\n";
  }
}
