#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, m;
  cin >> n >> m;
  vector<long long> a(n);
  vector<long long> b(m);
  for (auto &i : a) cin >> i;
  for (auto &i : b) cin >> i;
  if (n == 1) {
    for (auto x : b) cout << 1 << " " << x << endl;
    return;
  }
  vector<long long> pre(n);
  pre[0] = 0;
  pre[1] = a[0];
  for (long long i = 2; i < n; i++) pre[i] = a[i - 1] + pre[i - 1];
  for (long long i = 0; i < (long long)b.size(); i++) {
    auto it = lower_bound(pre.begin(), pre.end(), b[i]);
    it--;
    long long dom = it - pre.begin();
    cout << dom + 1 << " " << b[i] - *it << endl;
  }
}
int32_t main() {
  clock_t begin = clock();
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
}
