#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};
const int N = 2e5 + 10, M = 1e5 + 10, OOm = 0x3f3f3f3f;
string blank = "";
int n, m;
long long arr[N];
void solve() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
    arr[i] += arr[i - 1];
  }
  while (m--) {
    long long x;
    cin >> x;
    int i = lower_bound(arr + 1, arr + n + 1, x) - arr;
    cout << i << " " << x - arr[i - 1] << '\n';
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  solve();
  cerr << "Time elapsed: " << clock() / 1000 << " ms" << '\n';
}
