#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i, j;
  unsigned long long int sum = 0, temp;
  vector<unsigned long long int> a, b;
  cin >> n >> m;
  a.push_back(0);
  for (i = 0; i < n; i++) {
    cin >> temp;
    sum += temp;
    a.push_back(sum);
  }
  for (i = 0; i < m; i++) {
    cin >> temp;
    b.push_back(temp);
  }
  for (i = 0; i < m; i++) {
    auto low = lower_bound(a.begin(), a.end(), b[i]);
    low--;
    cout << (low - a.begin()) + 1 << " " << b[i] - *low << endl;
  }
  return 0;
}
