#include <bits/stdc++.h>
using namespace std;
inline int Int() {
  int x;
  scanf("%d", &x);
  return x;
}
inline long Long() {
  long x;
  scanf("%ld", &x);
  return x;
}
inline long long LLong() {
  long long x;
  scanf("%lld", &x);
  return x;
}
inline float Float() {
  float x;
  scanf("%f", &x);
  return x;
}
inline float Double() {
  double x;
  scanf("%lf", &x);
  return x;
}
inline pair<int, int> Pair() {
  pair<int, int> p;
  scanf("d", &p.first, &p.second);
  return p;
}
void S(char *x) { scanf("%s", x); }
void pI(int x) { printf("%d", x); }
void pL(long x) { printf("%ld", x); }
void pLL(long long x) { printf("%lld", x); }
void pUL(unsigned long long x) { printf("%llu", x); }
void pF(float x) { printf("%f", x); }
void pD(double x) { printf("%f", x); }
void pS(char x[]) { printf("%s", x); }
const double PI = acos(-1.0);
const double EPS = 1e-6;
const int MOD = (int)1e9 + 7;
const int maxn = (int)2e5 + 5;
long long a[maxn];
long long s[maxn];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = (1); i <= (n); i++) {
    cin >> a[i];
    s[i] = s[i - 1] + a[i];
  }
  for (int i = (1); i <= (m); i++) {
    long long r;
    cin >> r;
    long long dor, room, b = 1, e = n;
    while (b <= e) {
      int mid = (b + e) >> 1;
      if (s[mid] < r) {
        b = mid + 1;
      } else if (s[mid] >= r) {
        e = mid - 1;
        dor = mid;
      }
    }
    room = r - s[dor - 1];
    cout << dor << " " << room << "\n";
  }
  return 0;
}
