#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<long long> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 1; i < n; i++) a[i] += a[i - 1];
  vector<long long> b(m);
  for (int i = 0; i < m; i++) cin >> b[i];
  for (int i = 0; i < m; i++) {
    int fl = lower_bound(a.begin(), a.end(), b[i]) - a.begin();
    cout << fl + 1 << ' ' << b[i] - ((fl == 0) ? 0 : a[fl - 1]) << endl;
  }
  return 0;
}
