#include <bits/stdc++.h>
using namespace std;
const int N = 2 * 100 * 1000 + 7;
int n, m;
long long a[N];
pair<long long, long long> b[N];
pair<long long, long long> ans[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> b[i].first;
    b[i].second = i;
  }
  sort(b, b + m);
  long long sum = 0, ind = 0;
  for (int i = 0; i < m; i++) {
    while (sum < b[i].first) {
      sum += a[ind];
      ind++;
    }
    ans[b[i].second].first = ind;
    ans[b[i].second].second = b[i].first - sum + a[ind - 1];
  }
  for (int i = 0; i < m; i++) {
    cout << ans[i].first << " " << ans[i].second << endl;
  }
  return 0;
}
