#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;
}

### Prompt

Please provide a Cpp coded solution to the problem described below:

There are n dormitories in Berland State University, they are numbered with integers from 1 to n. Each dormitory consists of rooms, there are a_i rooms in i-th dormitory. The rooms in i-th dormitory are numbered from 1 to a_i.

A postman delivers letters. Sometimes there is no specific dormitory and room number in it on an envelope. Instead of it only a room number among all rooms of all n dormitories is written on an envelope. In this case, assume that all the rooms are numbered from 1 to a_1 + a_2 + ... + a_n and the rooms of the first dormitory go first, the rooms of the second dormitory go after them and so on.

For example, in case n=2, a_1=3 and a_2=5 an envelope can have any integer from 1 to 8 written on it. If the number 7 is written on an envelope, it means that the letter should be delivered to the room number 4 of the second dormitory.

For each of m letters by the room number among all n dormitories, determine the particular dormitory and the room number in a dormitory where this letter should be delivered.

Input

The first line contains two integers n and m (1 ≤ n, m ≤ 2 ⋅ 10^{5}) — the number of dormitories and the number of letters.

The second line contains a sequence a_1, a_2, ..., a_n (1 ≤ a_i ≤ 10^{10}), where a_i equals to the number of rooms in the i-th dormitory. The third line contains a sequence b_1, b_2, ..., b_m (1 ≤ b_j ≤ a_1 + a_2 + ... + a_n), where b_j equals to the room number (among all rooms of all dormitories) for the j-th letter. All b_j are given in increasing order.

Output

Print m lines. For each letter print two integers f and k — the dormitory number f (1 ≤ f ≤ n) and the room number k in this dormitory (1 ≤ k ≤ a_f) to deliver the letter.

Examples

Input

3 6
10 15 12
1 9 12 23 26 37


Output

1 1
1 9
2 2
2 13
3 1
3 12


Input

2 3
5 10000000000
5 6 9999999999


Output

1 5
2 1
2 9999999994

Note

In the first example letters should be delivered in the following order:

  * the first letter in room 1 of the first dormitory 
  * the second letter in room 9 of the first dormitory 
  * the third letter in room 2 of the second dormitory 
  * the fourth letter in room 13 of the second dormitory 
  * the fifth letter in room 1 of the third dormitory 
  * the sixth letter in room 12 of the third dormitory 

### Response

```cpp
#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;
}

```