#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<unsigned long long> a;
  vector<unsigned long long> b;
  for (int i = 0; i < n; i++) {
    unsigned long long x;
    cin >> x;
    a.push_back(x);
  }
  for (int i = 0; i < m; i++) {
    unsigned long long x;
    cin >> x;
    b.push_back(x);
  }
  vector<pair<unsigned long long, unsigned long long>> r;
  r.push_back({1, a[0]});
  for (int i = 1; i < n; i++) {
    r.push_back({r.back().second + 1, r.back().second + a[i]});
  }
  int ind = 0;
  for (int i = 0; i < b.size(); i++) {
    unsigned long long x = b[i];
    while (!(r[ind].first <= x && x <= r[ind].second)) {
      ind++;
    }
    if (r[ind].first <= x && x <= r[ind].second) {
      cout << ind + 1 << " " << x - r[ind].first + 1 << endl;
    }
  }
  return 0;
}
