#include <bits/stdc++.h>
using namespace std;
long long int abs1(long long int a) {
  if (a > 0) return a;
  return -1 * a;
}
long long int max1(long long int a, long long int b) {
  if (a > b) return a;
  return b;
}
long long int min1(long long int a, long long int b) {
  if (a < b) return a;
  return b;
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<long long int> a(n), b(m);
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < m; i++) cin >> b[i];
  vector<long long int> pre(n);
  pre[0] = a[0];
  for (int i = 1; i < n; i++) pre[i] = pre[i - 1] + a[i];
  for (int i = 0; i < m; i++) {
    int it = lower_bound(pre.begin(), pre.end(), b[i]) - pre.begin();
    cout << it + 1 << " ";
    long long int temp = b[i];
    if (pre[it] != b[i] && it != 0)
      it -= 1, temp -= pre[it];
    else if (pre[it] == b[i])
      temp -= pre[it];
    if (temp != 0)
      cout << temp << "\n";
    else
      cout << a[it] << "\n";
  }
  return 0;
}
