#include <bits/stdc++.h>
using namespace std;
bool prime[1000005];
void SieveOfEratosthenes() {
  memset(prime, true, sizeof(prime));
  for (int p = 2; p * p <= 1000005; p++) {
    if (prime[p] == true) {
      for (int i = p * p; i <= 1000005; i += p) prime[i] = false;
    }
  }
}
string toLower(string s) {
  for (int i = 0; i < s.size(); i++)
    if (s[i] >= 'A' && s[i] <= 'Z') s[i] = s[i] + 32;
  return s;
}
int main() {
  int n, m, i;
  cin >> n >> m;
  vector<long long int> v(n), ar(m);
  for (i = 0; i < n; i++) {
    cin >> v[i];
    if (i != 0) v[i] += v[i - 1];
  }
  for (long long int i = 0; i < m; i++) cin >> ar[i];
  ;
  for (i = 0; i < m; i++) {
    auto l = lower_bound(v.begin(), v.end(), ar[i]);
    int val = v[l - v.begin()];
    int index = l - v.begin() + 1;
    if (index == 1)
      cout << index << " " << ar[i] << "\n";
    else {
      cout << index << " " << ar[i] - v[index - 2] << "\n";
    }
  }
}
