#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  long long int m;
  cin >> m;
  vector<long long int> v;
  long long int temp;
  for (long long int i = 0; i < n; i++) {
    cin >> temp;
    v.push_back(temp);
  }
  long long int prefix[n + 1];
  prefix[0] = 0;
  for (long long int i = 0; i < n; i++) prefix[i + 1] = prefix[i] + v[i];
  long long int idx = 0;
  for (long long int i = 0; i < m; i++) {
    cin >> temp;
    while (prefix[idx + 1] < temp) idx++;
    cout << (idx + 1) << " " << temp - prefix[idx] << endl;
  }
  return 0;
}
