#include <bits/stdc++.h>
using namespace std;
bool *b;
long long int i, j;
long long int f[1005];
int main() {
  long long int n, m;
  cin >> n >> m;
  long long int a[n], b[m], s[n + 1];
  for (i = 0; i < n + 1; i++) s[i] = 0;
  for (i = 0; i < n; i++) {
    cin >> a[i], s[i + 1] = a[i];
    s[i + 1] += s[i];
  }
  for (i = 0; i < m; i++) cin >> b[i];
  i = 1;
  for (; i <= n;) {
    for (; j < m;) {
      if (b[j] <= s[i]) {
        cout << i << " " << b[j] - s[i - 1] << endl;
        j++;
        break;
      } else {
        i++;
        break;
      }
      if (j == m || i == n + 1) return 0;
    }
    if (j == m || i == n + 1) return 0;
  }
  if (j == m || i == n + 1) return 0;
  return 0;
}
