#include <bits/stdc++.h>
using namespace std;
int lower_bound(vector<long long> &v, long long key) {
  int l = 0, r = v.size() - 1, pos = -1;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (key <= v[mid]) {
      pos = mid;
      r = mid - 1;
    } else
      l = mid + 1;
  }
  return pos;
}
int main() {
  ios_base::sync_with_stdio(0);
  int n, m;
  cin >> n >> m;
  vector<long long> sum(n);
  for (int i = 0; i < n; ++i) {
    cin >> sum[i];
    if (i) sum[i] += sum[i - 1];
  }
  for (int i = 0; i < m; ++i) {
    long long pos;
    cin >> pos;
    int lo = lower_bound(sum, pos);
    printf("%d %lld\n", lo + 1, lo ? (pos - sum[lo - 1]) : pos);
  }
  return true & false;
}
