#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  long long a[n];
  long long b[m], res[m][2];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (i == 0) continue;
    a[i] += a[i - 1];
  }
  for (int i = 0; i < m; i++) {
    cin >> b[i];
  }
  for (int i = 0; i < m; i++) {
    int l = 0, h = n - 1;
    int j;
    while (true) {
      if (b[i] < a[0]) {
        j = 0;
        break;
      }
      if (b[i] == a[l]) {
        j = l;
        break;
      } else if (b[i] == a[h]) {
        j = h;
        break;
      } else {
        if (b[i] > a[(l + h) / 2]) {
          if (l == (l + h) / 2) {
            j = h;
            break;
          }
          l = (l + h) / 2;
        } else if (b[i] < a[(l + h) / 2]) {
          h = (l + h) / 2;
        } else {
          j = (l + h) / 2;
          break;
        }
      }
    }
    res[i][0] = j + 1;
    if (j == 0) {
      res[i][1] = b[i];
    } else {
      res[i][1] = b[i] - a[j - 1];
    }
    cout << res[i][0] << " " << res[i][1] << "\n";
  }
  return 0;
}
