#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  scanf("%d", &n);
  scanf("%d", &m);
  long long int a[n];
  long long int b[m];
  scanf("%lld", &a[0]);
  for (int i = 1; i < n; i++) {
    scanf("%lld", &a[i]);
    a[i] = a[i - 1] + a[i];
  }
  for (int i = 0; i < m; i++) {
    scanf("%lld", &b[i]);
  }
  int j = 0;
  for (int i = 0; i < m; i++) {
    for (; j < n; j++) {
      if (b[i] <= a[j]) {
        if (j == 0) {
          printf("%d %lld\n", j + 1, b[i]);
        } else {
          printf("%d %lld\n", j + 1, b[i] - a[j - 1]);
        }
        break;
      }
    }
  }
}
