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 + \dots + 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 \le n, m \le 2 \cdot 10^{5})$ — the number of dormitories and the number of letters.

The second line contains a sequence $a_1, a_2, \dots, a_n$ $(1 \le a_i \le 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, \dots, b_m$ $(1 \le b_j \le a_1 + a_2 + \dots + 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 \le f \le n)$ and the room number $k$ in this dormitory $(1 \le k \le 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
[{"code": "d,l = list(map(int,input().split()))\n\na = list(map(int,input().split()))\nletters = list(map(int,input().split()))\n\npos = [0] * (1+d)\n\nfor i,x in enumerate(a):\n    pos[i+1] = pos[i] + x\n\nres = []\ni = 1\nfor letter in letters:\n    while pos[i]<letter: i+=1\n    res.append(str(i) + \" \" + str(letter - pos[i-1]))\nprint('\\n'.join(res))\n", "passed": true, "time": 0.15, "memory": 14228.0, "status": "done"}, {"code": "n, m = map(int, input().split(' '))\na = list(map(int, input().split(' ')))\nb = list(map(int, input().split(' ')))\nminus = 0\nid = 0\nfor i in b:\n    while 1:\n        if i - minus > a[id]:\n            minus += a[id]\n            id += 1\n        else:\n            print(id + 1, i - minus)\n            break", "passed": true, "time": 0.22, "memory": 14144.0, "status": "done"}, {"code": "n, m = map(int, input().split())\nhosts = [0]\nhosts += list(map(int, input().split()))\nfor i in range(1, n + 1):\n    hosts[i] += hosts[i - 1]\nletters = list(map(int, input().split()))\nj = 0\nfor i in range(m):\n    while hosts[j] < letters[i]:\n        j += 1\n    print(j, letters[i] - hosts[j - 1])", "passed": true, "time": 0.14, "memory": 14340.0, "status": "done"}, {"code": "\nn,m=(list(map(int,input().strip().split(' '))))\narr=list((list(map(int,input().strip().split(' ')))))\ndp=[arr[0]]\nfor i in range(1,n):\n  dp.append(dp[i-1]+arr[i])\nbrr=list((list(map(int,input().strip().split(' ')))))\nstart = 0\nfor i in range(m):\n  x=brr[i]\n  for j in range(start,n):\n    if(dp[j]>=brr[i]):\n      if(j!=0):\n        print(j+1,x-dp[j-1])\n      else:\n        print(j+1,x)\n      start = j\n      break\n", "passed": true, "time": 1.55, "memory": 14300.0, "status": "done"}, {"code": "from bisect import bisect_left\nfrom itertools import accumulate\n\nn, m = list(map(int, input().split()))\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\n\ns_a = [0] + list(accumulate(a))\nans = list()\n\nfor el in b:\n    ind = bisect_left(s_a, el)\n    num = el - s_a[ind - 1]\n\n    ans.append(f'{ind} {num}')\n\nprint('\\n'.join(ans))\n", "passed": true, "time": 0.16, "memory": 14148.0, "status": "done"}, {"code": "n,m = list(map(int,input().split()))\nrooms = [int(i) for i in input().split()]\nletters = [int(i) for i in input().split()]\n\nroom = rooms[0]\nroomsum = 0\ncnt = 1\nfor i in range(m):\n    if letters[i]<=room:\n        print(cnt,letters[i]-roomsum)\n    else:\n        while letters[i]>room:\n            roomsum = room\n            room += rooms[cnt]\n            cnt += 1\n        print(cnt,letters[i]-roomsum)\n", "passed": true, "time": 0.15, "memory": 14068.0, "status": "done"}, {"code": "T = input().split(' ')\nn = int(T[0])\nm = int(T[1])\nP = input().split(' ')\nfor i in range(len(P)):\n    P[i] = int(P[i])\nfor i in range(1, len(P)):\n    P[i] += P[i-1]\nQ = input().split(' ')\nfor i in range(len(Q)):\n    Q[i] = int(Q[i])\na = 0\nb = 0\nc = 0\nd = 0\nwhile c < len(Q):\n    b = Q[c]\n    if b > P[a]:\n        d = P[a]\n        a+=1\n    else:\n        print(a+1, end=' ')\n        print(b - d)\n        c+=1\n", "passed": true, "time": 0.23, "memory": 14400.0, "status": "done"}, {"code": "n,m=map(int,input().split())\na=list(map(int,input().split()))\nb=list(map(int,input().split()))\nj=0\nmk=a[0]\ni=0\nwhile(i!=m):\n    if b[i]>mk:\n        j+=1\n        mk+=a[j]\n    else:\n        print(j+1,a[j]-(mk-b[i]))\n        i+=1", "passed": true, "time": 0.23, "memory": 14408.0, "status": "done"}, {"code": "#!/usr/bin/env python3\nfrom sys import stdin, stdout\nfrom bisect import bisect, bisect_left\n\ndef rint():\n    return list(map(int, stdin.readline().split()))\n#lines = stdin.readlines()\n\n\nn, m = rint()\na = list(rint())\nb = list(rint())\n\nc =[]\nc.append(a[0])\nfor i in range(1,n):\n    c.append(c[i-1]+a[i])\n\nfor i in range(m):\n    ii = bisect_left(c, b[i])\n    if ii == 0:\n        print(1, b[i])\n    else:\n        print(ii+1,b[i] - c[ii-1])\n", "passed": true, "time": 0.23, "memory": 14080.0, "status": "done"}, {"code": "from itertools import accumulate\n\ndef main():\n\tn, m = [int(_) for _ in input().split()]\n\ta = [int(_) for _ in input().split()]\n\tb = [int(_) for _ in input().split()]\n\n\n\n\ti = 0\n\tacc = 0\n\tfor x in b:\n\t\twhile acc + a[i] < x:\n\t\t\tacc += a[i]\n\t\t\ti += 1\n\t\tprint(i + 1, x - acc)\n\n\ndef __starting_point():\n\tmain()\n\n__starting_point()", "passed": true, "time": 0.19, "memory": 14144.0, "status": "done"}, {"code": "n, m = [int(i) for i in input().split()]\nrooms = [0] + [int(i) for i in input().split()]\nfor i in range(2, n + 1):\n\trooms[i] += rooms[i - 1]\nletters = [int(i) for i in input().split()]\nfor i in range(m):\n\tp = 0\n\tq = n\n\twhile True:\n\t\tposition = (p + q) // 2\n\t\tif rooms[position] < letters[i]:\n\t\t\tp = position\n\t\telse:\n\t\t\tq = position\n\t\tif q - p <= 1:\n\t\t\tprint(q, letters[i] - rooms[p])\n\t\t\tbreak\n", "passed": true, "time": 0.22, "memory": 14152.0, "status": "done"}, {"code": "from bisect import bisect_left\n\na, b = list(map(int, input().split()))\nflats = list(map(int, input().split()))\nlets = list(map(int, input().split()))\n\nnflats = []\ns = 0\nfor x in flats:\n    s += x\n    nflats.append(s)\n\nfor x in lets:\n    y = bisect_left(nflats, x)\n    if y != 0:\n        print(y+1, x - nflats[y-1])\n    else:\n        print(y+1, x)\n", "passed": true, "time": 0.15, "memory": 14304.0, "status": "done"}, {"code": "from bisect import bisect_left\n\nn, m = list(map(int, input().split()))\na = [int(x) for x in input().split()]\nb = [int(x) for x in input().split()]\nt = [0]\ns = 0\nfor x in a:\n    s += x\n    t.append(s)\n\nfor x in b:\n    p = bisect_left(t, x)\n    print(p, x - t[p - 1])\n", "passed": true, "time": 0.14, "memory": 14112.0, "status": "done"}, {"code": "n, m = list(map(int, input().split()))\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\nprefix = [0]\nsumm = 0\nfor i in range(n - 1):\n\tsumm += a[i]\n\tprefix.append(summ)\ndef binsearch(x, a):\n\tleft = 0\n\tright = len(prefix)\n\twhile left != right - 1:\n\t\tmid = (left + right) // 2\n\t\tif (x[mid] < a):\n\t\t\tleft = mid\n\t\telse:\n\t\t\tright = mid\n\treturn left\nfor i in range(m):\n\tq = binsearch(prefix, b[i])\n\tv = b[i] - prefix[q]\n\tprint(q + 1, v)\n\t\n", "passed": true, "time": 0.14, "memory": 14308.0, "status": "done"}, {"code": "n,m=map(int,input().split())\narr1=list(map(int,input().split()))\narr=list(map(int,input().split()))\narr2=[]\nsumx=0\nfor i in range(n):\n\tsumx+=arr1[i]\n\tarr2.append(sumx)\nj=0\nk=0\nwhile(j<m):\n\tif(arr[j]<=arr2[k]):\n\t\tif(k==0):\n\t\t\tprint(k+1,arr[j])\n\t\telse:\n\t\t\tprint(k+1,arr[j]-arr2[k-1])\n\telse:\n\t\twhile(arr[j]>arr2[k]):\n\t\t\tk+=1\n\t\tprint(k+1,arr[j]-arr2[k-1])\n\tj+=1", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "import sys\nimport bisect\n\n\nnext(sys.stdin)\n\nais = list(map(int, next(sys.stdin).rstrip().split()))\n\nrooms = list(map(int, next(sys.stdin).rstrip().split()))\n\nborders = [ais[0]]\nfor a in ais[1:]:\n    borders.append(borders[-1] + a)\n\nresult = []\n\nfor room in rooms:\n    dorm_num = bisect.bisect_left(borders, room) + 1\n    if dorm_num > 1:\n        room -= borders[dorm_num - 2]\n    result.append('%s %s' % (dorm_num, room))\n\nfor r in result:\n    print(r)\n", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "R = lambda: list(map(int, input().split()))\n\nn, m = R()\na = list(R())\na.append(10**6)\n\ns = 0\nf = 0\n\nfor b in R():\n    while s < b:\n        s += a[f]\n        f += 1\n    print(f, b - s + a[f-1])\n", "passed": true, "time": 0.14, "memory": 14132.0, "status": "done"}, {"code": "import bisect,itertools\nn,m=map(int,input().split())\naa=list(map(int,input().split()))\na,c=[0]+list(itertools.accumulate(aa)),0\nfor b in input().split():\n    b=int(b)\n    f=bisect.bisect_left(a,b,lo=c)\n    k=b-a[f-1]\n    print(f,k)\n    c=max(c,f)", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "def main():\n    n, m = list(map(int, input().split()))\n    room = [int(x) for x in input().split()]\n    letter = [int(x) for x in input().split()]\n\n    room_num = 0\n    j = 0\n    for d in range(n):\n        while j < m and letter[j] <= room_num + room[d]:\n            r = letter[j] - room_num\n            print(d+1, r)\n            j += 1\n        room_num += room[d]\n\n\ndef __starting_point():\n    main()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14128.0, "status": "done"}, {"code": "read=lambda:map(int,input().split())\nn,m=read()\na=list(read())\nb=list(read())\npos=0\npre=0\nfor i in b:\n    d=0\n    while True:\n        d=i-1-pre\n        if d>=a[pos]: pre+=a[pos];pos+=1\n        else: break\n    print(pos+1,d+1)", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "import bisect\n\n\ndef read_nums():\n    return [int(x) for x in input().split()]\n\n\ndef main():\n    n, m = read_nums()\n    num_rums = read_nums()\n\n    s = 0\n    run_sums = [0]\n    for run_num in num_rums:\n        s += run_num\n        run_sums.append(s)\n\n    letters = read_nums()\n    res = []\n    for letter in letters:\n        index = bisect.bisect_left(run_sums, letter)\n        res.append((index, letter - run_sums[index - 1]))\n\n    for r in res:\n        print(r[0], r[1])\n\n\ndef __starting_point():\n    main()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14188.0, "status": "done"}, {"code": "n,m=[int(x) for x in input().strip().split(' ')]\na=[int(x) for x in input().strip().split(' ')]\nb=[int(x) for x in input().strip().split(' ')]\ns=[1]*(n+1)\nfor i in range(1,n+1):\n    s[i]=s[i-1]+a[i-1]\nidx=0\nfor i in range(m):\n    while True:\n        if b[i]<s[idx+1]:\n            print(idx+1,b[i]-s[idx]+1)\n            break\n        else:\n            idx+=1", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "n, m = list(map(int, input().split()))\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\nroomsT = 0\ncurrD = -1\nfor x in range(m):\n    toFind = b[x]\n    while roomsT < b[x] and currD < n:\n        currD += 1\n        roomsT += a[currD]\n    roomsT -= a[currD]\n    currD -= 1\n    tempR = toFind - roomsT\n    print(currD +2, tempR)\n\n", "passed": true, "time": 0.19, "memory": 14392.0, "status": "done"}, {"code": "n,m=list(map(int,input().split()))\n\nalist=list(map(int,input().split()))\n\nblist=list(map(int,input().split()))\n\nprefixsum=[0]\n\nfor i in range(n):\n\tprefixsum.append(alist[i]+prefixsum[-1])\n#print(prefixsum)\nptr=1\nfor i in range(m):\n\twhile blist[i]>prefixsum[ptr]:\n\t\tptr+=1\n\n\troom=blist[i]-prefixsum[ptr-1]\n\tprint(ptr,room)\n\t\n\n", "passed": true, "time": 0.14, "memory": 14376.0, "status": "done"}, {"code": "from bisect import bisect_left\n\nn, l = list(map(int, input().split()))\nfl = list(map(int, input().split()))\nlet = list(map(int, input().split()))\n\npref = [0]\nfor i in range(n):\n    pref.append(fl[i] + pref[i])\n\nprev = 0\nfor l in let:\n    dorm = bisect_left(pref, l, lo=prev)\n    prev = dorm\n    print(dorm, l - pref[dorm - 1])\n", "passed": true, "time": 0.14, "memory": 14380.0, "status": "done"}]