#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, q;
  cin >> n >> q;
  pair<long long, long long> a[n + 1];
  for (int i = 1; i <= n; i++) {
    long long x;
    cin >> x;
    if (i == 1)
      a[i].first = 1;
    else
      a[i].first = a[i - 1].second + 1;
    a[i].second = a[i].first + x - 1;
  }
  while (q--) {
    long long x;
    cin >> x;
    int l = 1, r = n;
    while (l <= r) {
      int mid = (l + r) / 2;
      if (a[mid].first <= x && a[mid].second >= x) {
        cout << mid << " " << x - a[mid].first + 1 << '\n';
        break;
      } else {
        if (a[mid].first > x)
          r = mid - 1;
        else if (a[mid].second < x)
          l = mid + 1;
      }
    }
  }
  return 0;
}
