#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long int n, m;
  cin >> n >> m;
  long long int a[n], b[m];
  long long int aux[n];
  for (long long int i = 0; i < n; ++i) {
    cin >> a[i];
    if (i == 0)
      aux[i] = a[i];
    else
      aux[i] = aux[i - 1] + a[i];
  }
  for (long long int i = 0; i < m; ++i) cin >> b[i];
  long long int j = 0;
  for (long long int i = 0; i < m; ++i) {
    while (j < n && aux[j] < b[i]) ++j;
    if (j == 0)
      cout << j + 1 << " " << b[i] << endl;
    else
      cout << j + 1 << " " << b[i] - aux[j - 1] << endl;
  }
}
