#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  long long room;
  cin >> n >> m;
  vector<long long> dormitories(n);
  for (int i = 0; i < n; i++) {
    cin >> dormitories[i];
    if (i > 0) dormitories[i] += dormitories[i - 1];
  }
  for (int i = 0; i < m; i++) {
    cin >> room;
    int aux = upper_bound(dormitories.begin(), dormitories.end(), room - 1) -
              dormitories.begin();
    long long calc = 0;
    if (aux > 0) calc = dormitories[aux - 1];
    cout << aux + 1 << " " << room - calc << '\n';
  }
  return 0;
}
