#include <bits/stdc++.h>
using namespace std;
long long int srch(long long int a[], long long int k, long long int n) {
  long long int right = n, left = 0;
  long long int mid = (right + left) >> 1;
  while (left < right) {
    if (a[mid] < k) {
      left = mid + 1;
    } else {
      right = mid;
    }
    mid = (right + left) >> 1;
  }
  return mid;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int m, n, i, j, k, flag = 0;
  cin >> n >> m;
  long long int a[n + 1];
  a[0] = 0;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    a[i] += a[i - 1];
  }
  while (m--) {
    cin >> k;
    int mid = srch(a, k, n);
    cout << mid << " " << k - a[mid - 1] << endl;
  }
  return 0;
}
