#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m;
  cin >> n >> m;
  long long arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  vector<long long> pref(n);
  pref[0] = arr[0];
  for (int i = 1; i < n; i++) {
    pref[i] = arr[i] + pref[i - 1];
  }
  int l[m];
  for (int i = 0; i < m; i++) {
    long long a;
    cin >> a;
    auto it = lower_bound(pref.begin(), pref.end(), a);
    int first = it - pref.begin();
    if (first == 0)
      cout << first + 1 << " " << a << endl;
    else
      cout << first + 1 << " " << a - pref[first - 1] << endl;
  }
}
