#include <bits/stdc++.h>
using namespace std;
long long a[10000010];
long long n, m;
long long b[10000010];
signed main() {
  cin >> n >> m;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (long long i = 1; i <= n; i++) {
    b[i] = a[i] + b[i - 1];
  }
  while (m--) {
    long long pos;
    cin >> pos;
    long long xl = lower_bound(b + 1, b + n + 1, pos) - b;
    cout << xl << ' ' << pos - b[xl - 1] << endl;
  }
  return 0;
}
