#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
long long power(long long a, long long b) {
  long long ans = 1;
  while (b > 0) {
    if (b & 1) ans *= a;
    a = a * a;
    b >>= 1;
  }
  return ans;
}
long long powm(long long a, long long b) {
  a %= MOD;
  long long ans = 1;
  while (b > 0) {
    if (b & 1) ans = (ans * a) % MOD;
    a = (a * a) % MOD;
    b >>= 1;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long n, m;
  cin >> n >> m;
  vector<long long> A(n), B(m), dp;
  dp.push_back(0);
  for (long long &x : A) {
    cin >> x;
    dp.push_back(dp.back() + x);
  }
  for (long long &x : B) cin >> x;
  int idx = 0;
  for (int i = 0; i < m; i++) {
    for (int j = max(1, idx); j < (int)dp.size(); j++) {
      if (B[i] > dp[j - 1] && B[i] <= dp[j]) {
        cout << j << " " << B[i] - dp[j - 1] << "\n";
        idx = j;
        break;
      }
    }
  }
  return 0;
}
