#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<pair<int, long long> > v1;
  vector<long long> v;
  map<long long, int> l;
  int n, m;
  cin >> n >> m;
  v1.resize(m + 1);
  v.resize(n + 1);
  v[0] = 0;
  l[v[0]] = 0;
  for (int i = 1; i <= n; i++) {
    cin >> v[i];
    v[i] += v[i - 1];
    l[v[i]] = i;
  }
  for (int i = 0; i < m; i++) {
    long long b;
    cin >> b;
    long long x = *lower_bound(v.begin(), v.end(), b);
    v1[i].first = l[x];
    v1[i].second = b - v[l[x] - 1];
  }
  for (int i = 0; i < m; i++) {
    cout << v1[i].first << ' ' << v1[i].second << endl;
  }
  return 0;
}
