#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
const int INF = 2e9 + 10;
const int mod = 1e9 + 7;
const long long LINF = 4e18 + 10;
int n, m;
long long num[N], rooms[N], sum[N];
int main() {
  if ("" != "") {
    freopen(
        ""
        ".in",
        "r", stdin);
    freopen(
        ""
        ".out",
        "w", stdout);
  }
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) {
    cin >> rooms[i];
  }
  for (int i = 1; i <= m; ++i) {
    cin >> num[i];
  }
  for (int i = 2; i <= n; ++i) {
    sum[i] = sum[i - 1] + rooms[i - 1];
  }
  for (int i = 1; i <= m; ++i) {
    int l = 1, r = n + 1;
    while (r - l > 1) {
      long long m = l + (r - l) / 2;
      if (sum[m] < num[i]) {
        l = m;
      } else {
        r = m;
      }
    }
    cout << l << ' ' << num[i] - sum[l] << '\n';
  }
  return 0;
}
