#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  vector<long long> a(n);
  for (auto& it : a) cin >> it;
  vector<long long> b(m);
  for (auto& it : b) cin >> it;
  long long pre[n];
  pre[0] = a[0];
  for (int i = 1; i < n; i++) {
    pre[i] = pre[i - 1] + a[i];
  }
  for (int i = 0; i < m; i++) {
    int l = -1, r = n;
    while (r > l + 1) {
      int m = (l + r) / 2;
      if (pre[m] < b[i])
        l = m;
      else
        r = m;
    }
    if (l + 1 == 0)
      cout << l + 2 << " " << b[i] << endl;
    else
      cout << l + 2 << " " << b[i] - pre[l] << endl;
  }
}
