#include <bits/stdc++.h>
using namespace std;
long long N, M, v[200005];
pair<long long, long long> out[200005];
pair<long long, long long> q[200005];
int main() {
  cin >> N >> M;
  for (long long i = 1; i <= N; i++) cin >> v[i], v[i] += v[i - 1];
  for (long long i = 1; i <= M; i++) {
    cin >> q[i].first;
    q[i].second = i;
  }
  sort(q + 1, q + 1 + M);
  long long P = 1;
  for (long long i = 1; i <= M; i++) {
    while (v[P] < q[i].first) P++;
    out[q[i].second] = {P, q[i].first - v[P - 1]};
  }
  for (long long i = 1; i <= M; i++) {
    cout << out[i].first << ' ' << out[i].second << '\n';
  }
  return 0;
}
