#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  long long n;
  cin >> n;
  long long m;
  cin >> m;
  vector<long long> a(n);
  for (auto &x : a) {
    cin >> x;
  }
  long long dorm = 0;
  long long sum = 0;
  for (int i = 0; i < m; ++i) {
    long long let;
    cin >> let;
    while (let > sum + a[dorm]) {
      sum += a[dorm];
      dorm++;
    }
    cout << dorm + 1 << " " << let - sum << endl;
  }
  return 0;
}
