#include <bits/stdc++.h>
using namespace std;
long long int a[1000000], b[1000000];
int main() {
  long long int n, m, i, p, count = 0, s = 0;
  vector<long long int> v;
  cin >> n >> m;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    s = s + a[i];
    v.push_back(s);
  }
  for (i = 0; i < m; i++) {
    cin >> b[i];
  }
  for (i = 0; i < m; i++) {
    p = lower_bound(v.begin(), v.end(), b[i]) - v.begin();
    if (p == 0)
      cout << 1 << " " << b[i] << endl;
    else {
      cout << p + 1 << " " << b[i] - v[p - 1] << endl;
    }
  }
}
