#include <bits/stdc++.h>
using namespace std;
int N, M;
long long sum[200001];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> N >> M;
  for (int i = 1; i <= N; i++) {
    long long num;
    cin >> num;
    sum[i] = sum[i - 1] + num;
  }
  for (int i = 0; i < M; i++) {
    long long val;
    cin >> val;
    int sol;
    long long sol2;
    int left = 1;
    int right = N;
    while (left <= right) {
      int mid = (left + right) / 2;
      if (val <= sum[mid]) {
        sol = mid;
        sol2 = val - sum[mid - 1];
        right = mid - 1;
      } else {
        left = mid + 1;
      }
    }
    cout << sol << ' ' << sol2 << '\n';
  }
  return 0;
}
