#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 7;
int n, m;
long long a[maxn], b[maxn], pref[maxn];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    pref[i] = pref[i - 1] + a[i];
  }
  for (int i = 1; i <= m; i++) {
    cin >> b[i];
    int l = 0, r = n;
    while (r - l > 1) {
      int mid = l + (r - l) / 2;
      if (b[i] > pref[mid]) {
        l = mid;
      } else {
        r = mid;
      }
    }
    cout << r << ' ' << b[i] - pref[r - 1] << '\n';
  }
}
