#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  long long a[200005];
  a[0] = 0;
  for (int i = 1; i <= n; i++) {
    long long x;
    cin >> x;
    a[i] = x + a[i - 1];
  }
  for (int i = 0; i < m; i++) {
    long long x;
    cin >> x;
    long long s = 1, e = n, mid;
    long long ans = lower_bound(a, a + n, x) - a;
    cout << ans << " " << abs(a[ans - 1] - x) << endl;
  }
  return 0;
}
