#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, input;
  cin >> n >> m;
  long long int *a = new long long int[n + 1];
  a[0] = 0;
  for (int c = 1; c <= n; c++) {
    cin >> a[c];
    a[c] += a[c - 1];
  }
  for (int c = 0, i = 1; c < m; c++) {
    cin >> input;
    while (input > a[i]) i++;
    cout << i << ' ' << input - a[i - 1] << endl;
  }
}
