#include <bits/stdc++.h>
using namespace std;
const long long MAX = 1e7 + 7;
long long n, m, a[MAX], b[MAX], id[MAX];
void slove() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    id[i] = id[i - 1] + a[i];
  }
  while (m--) {
    long long s, x, y, vt = 0;
    cin >> s;
    int dau = 1, cuoi = n, giua;
    while (dau <= cuoi) {
      giua = (dau + cuoi) / 2;
      if (s > id[giua]) {
        vt = giua;
        dau = giua + 1;
      } else {
        cuoi = giua - 1;
      }
    }
    cout << vt + 1 << " " << s - id[vt] << endl;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int test = 1;
  while (test--) slove();
  return 0;
}
