#include <bits/stdc++.h>
using namespace std;
long long p[100000];
set<string> r;
set<pair<long long, long long> > c;
set<pair<long long, long long> >::iterator itr;
map<long long, long long> co;
map<long long, long long> mp;
map<char, long long> m;
map<char, long long> mcp;
map<long long, long long>::iterator it;
map<char, long long>::iterator x;
map<long long, long long>::iterator y;
map<long long, long long>::iterator z;
vector<string> v[1000000];
vector<string>::iterator itt;
stack<int> stk;
queue<int> qu;
pair<long long, long long> g;
int main() {
  long long n, m, p;
  cin >> n >> m;
  long long a[n], b[m];
  a[0] = 0;
  cin >> a[1];
  for (long long i = 2; i < n + 1; i++) {
    cin >> a[i];
    a[i] += a[i - 1];
  }
  for (long long j = 0; j < m; j++) cin >> b[j];
  long long i = 0;
  for (long long j = 0; j < n + 1; j++) {
    for (long long k = i; k < m; k++) {
      if (b[k] <= a[j]) {
        if (b[k] - a[j - 1] > 0)
          cout << j << " " << b[k] - a[j - 1] << endl;
        else
          break;
      } else {
        i = k;
        break;
      }
    }
  }
  return 0;
}
