#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 50, mod = 1e9 + 7;
long long arr[N], ar[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m, x;
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) {
    cin >> arr[i];
  }
  for (int i = 1; i <= m; ++i) {
    cin >> ar[i];
  }
  long long sum = 0;
  int i = 1;
  for (int j = 1; j <= m; ++j) {
    ar[j] -= sum;
    if (ar[j] <= arr[i]) {
      cout << i << " " << ar[j] << "\n";
    } else {
      ar[j] += sum;
      sum += arr[i];
      ++i;
      --j;
    }
  }
  return 0;
}
