#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100000;
const int INF = 0x3f3f3f3f;
long long a[201010];
int main() {
  ios::sync_with_stdio(false);
  long long n, m;
  while (cin >> n >> m) {
    a[0] = 0;
    for (int i = 1; i <= n; i++) {
      long long te;
      cin >> te;
      a[i] = te + a[i - 1];
    }
    for (int i = 0; i < m; i++) {
      long long b;
      cin >> b;
      int now = upper_bound(a, a + n, b) - a;
      int ans = a[now] - a[now - 1] - (a[now] - b);
      if (ans)
        cout << now << " " << a[now] - a[now - 1] - (a[now] - b) << endl;
      else
        cout << now - 1 << " " << a[now - 1] - a[now - 2] << endl;
    }
  }
  return 0;
}
