#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  long long int x, y;
  vector<long long int> ar;
  cin >> x;
  ar.push_back(x);
  for (int i = 1; i < n; i++) {
    cin >> x;
    ar.push_back(x);
    ar[i] = ar[i - 1] + ar[i];
  }
  for (int j = 0; j < m; j++) {
    cin >> y;
    vector<long long int>::iterator it;
    it = lower_bound(ar.begin(), ar.end(), y);
    long long int cnt = it - ar.begin();
    cout << cnt + 1 << ' ';
    if (cnt == 0)
      cout << y << endl;
    else
      cout << abs(ar[cnt - 1] - y) << endl;
  }
}
