#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T gcd(T a, T b) {
  while (b) {
    a = a % b;
    swap(a, b);
  }
  return a;
}
vector<pair<long long int, long long int>> inputs;
int lb(long long int num) {
  int l = 0;
  int h = inputs.size() - 1;
  while (l <= h) {
    int mid = (l + h) / 2;
    if (inputs[mid].first >= num) {
      h = mid - 1;
    } else {
      l = mid + 1;
    }
  }
  return l;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  long long int sum = 0;
  long long int sub = 0;
  for (int i = 0; i < n; i++) {
    long long int number;
    cin >> number;
    sum += number;
    inputs.push_back(make_pair(sum, sub));
    sub += number;
  }
  int si = 0;
  for (int i = 0; i < m; i++) {
    long long int number;
    cin >> number;
    int lowerBoundIndex = lb(number);
    si = lowerBoundIndex;
    long long int res = number - inputs[lowerBoundIndex].second;
    cout << lowerBoundIndex + 1 << " " << res << endl;
  }
  int xxxxx;
  cin >> xxxxx;
  return 0;
}
