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