#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  long long a[n], b[m];
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < m; i++) cin >> b[i];
  long long sum = 0, pos = 0;
  for (int i = 0; i < m; i++) {
    while (sum + a[pos] < b[i]) {
      sum += a[pos++];
    }
    cout << pos + 1 << " " << b[i] - sum << endl;
  }
  return 0;
}
