#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  long long int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  long long int d[m];
  long long int f = 1, x = 0;
  for (int i = 0; i < m; i++) {
    cin >> d[i];
    while (1) {
      long long int k = d[i] - x;
      if (k <= a[f - 1]) {
        cout << f << " " << k << endl;
        break;
      } else {
        x += a[f - 1];
        f++;
      }
    }
  }
}
