#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  long long a[n], cumm[n], q[m];
  vector<long long> v;
  for (int i = 0; i < n; i++) cin >> a[i];
  v.push_back(a[0]);
  for (int i = 1; i < n; i++) {
    vector<long long>::iterator it = v.end();
    it--;
    v.push_back((*it + a[i]));
  }
  for (int i = 0; i < m; i++) cin >> q[i];
  for (int i = 0; i < m; i++) {
    long long query = q[i];
    vector<long long>::iterator it = lower_bound(v.begin(), v.end(), query);
    if (*it == query) {
      cout << (it - v.begin() + 1) << " " << a[it - v.begin()] << endl;
    } else {
      if (it == v.begin()) {
        cout << (it - v.begin() + 1) << " ";
        cout << query << endl;
      } else {
        cout << (it - v.begin() + 1) << " ";
        it--;
        cout << (-(*it) + query) << endl;
      }
    }
  }
  return 0;
}
