#include <bits/stdc++.h>
using namespace std;
vector<long long> arr1;
long long arr2[200041];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i <= n - 1; i++) {
    long long x;
    cin >> x;
    arr1.push_back(x);
    if (i) arr1[i] += arr1[i - 1];
  }
  for (int j = 0; j <= m - 1; j++) {
    cin >> arr2[j];
    int t = lower_bound(arr1.begin(), arr1.end(), arr2[j]) - arr1.begin();
    if (t) arr2[j] -= arr1[t - 1];
    cout << t + 1 << ' ' << arr2[j] << '\n';
  }
  return 0;
}
