#include <bits/stdc++.h>
using namespace std;
int solve() {
  long long n, m, x, y = 0, l;
  cin >> n >> m;
  vector<long long> a;
  a.push_back(0);
  for (int i = 0; i < n; i++) {
    cin >> x;
    a.push_back(x + y);
    y += x;
  }
  for (int i = 0; i < m; i++) {
    cin >> x;
    l = lower_bound((a).begin(), (a).end(), x) - a.begin();
    cout << l << " " << x - a[l - 1] << '\n';
  }
  return 0;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
