#include <bits/stdc++.h>
using namespace std;
const int N = int(2e5 + 100);
long long a[N];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (i) {
      a[i] += a[i - 1];
    }
  }
  for (int i = 0; i < m; i++) {
    long long x;
    cin >> x;
    int ind = lower_bound(a, a + n, x) - a;
    long long room;
    if (ind == 0) {
      room = x;
    } else {
      room = x - a[ind - 1];
    }
    cout << ind + 1 << ' ' << room << endl;
  }
  return 0;
}
