#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, m;
  long long total = 0;
  cin >> n >> m;
  vector<long long> a(n), b(m);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    if (i > 0) a[i] += a[i - 1];
  }
  int dor = 0;
  long long room;
  for (int i = 0; i < m; ++i) {
    cin >> b[i];
  }
  for (int i = 0; i < m; ++i) {
    while (a[dor] < b[i]) {
      dor++;
    }
    if (!dor)
      room = b[i];
    else
      room = b[i] - a[dor - 1];
    cout << dor + 1 << " " << room << "\n";
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  solve();
  return 0;
}
