#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const int32_t M = 1e9 + 7;
const int32_t mod = 1e9 + 7;
const int32_t MM = 998244353;
bool prime[100000];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  vector<long long> v(n + 1);
  for (long long i = 1; i <= n; i++) {
    cin >> v[i];
  }
  v[0] = 0;
  for (long long i = 1; i <= n; i++) {
    v[i] = v[i] + v[i - 1];
  }
  while (m--) {
    long long q;
    cin >> q;
    auto i_d = lower_bound(v.begin(), v.end(), q) - v.begin();
    long long ans = q - v[i_d - 1];
    cout << i_d << " " << ans << endl;
  }
}
