#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T read() {
  T x;
  cin >> x;
  return x;
}
struct sum_t : vector<long long> {
  sum_t(int n) {
    push_back(0);
    for (int i = 0; i < n; i++) push_back(back() + read<long long>());
  }
  void letter(long long a) const {
    auto it = cbegin(), iu = cend();
    int p = upper_bound(it, iu, a - 1) - it;
    cout << p << ' ' << (a - at(p - 1)) << '\n';
  }
};
int main() {
  ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
  int n = read<int>(), m = read<int>();
  sum_t x(n);
  for (int i = 0; i < m; i++) x.letter(read<long long>());
}
