#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  unsigned long long int dor[n];
  unsigned long long int let[m];
  for (int i = 0; i < n; i++) {
    cin >> dor[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> let[i];
  }
  unsigned long long int sum = 0;
  unsigned long long int kk = 0;
  for (int i = 0; i < n; i++) {
    unsigned long long int j = let[kk] - sum;
    while (j <= dor[i]) {
      cout << i + 1 << " " << j << endl;
      kk++;
      if (kk >= m) {
        break;
        break;
      }
      j = let[kk] - sum;
    }
    sum = sum + dor[i];
  }
}
