#include <bits/stdc++.h>
using namespace std;
int mpow(int base, int exp);
void ipgraph(int m);
const int mod = 1000000007;
const int N = 3e5, M = N;
long long arr[N], b[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
    arr[i] += arr[i - 1];
  }
  for (int i = 1; i <= m; i++) {
    cin >> b[i];
  }
  for (int i = 1; i <= m; i++) {
    long long target = b[i];
    long long low = 1, high = n;
    while (high > low) {
      long long mid = (low + high) / 2;
      if (arr[mid] >= target) {
        high = mid;
      } else
        low = mid;
      if (high - low < 10) break;
    }
    long long ans;
    for (int j = low; j <= high; j++) {
      if (arr[j] >= target) {
        ans = j;
        break;
      }
    }
    cout << ans << " " << b[i] - arr[ans - 1] << endl;
  }
}
