N, T = map(int, input().split())
A = list(map(int, input().split()))

l = 0
A_: list = [0]

for i in range(N):
    l += A[i]
    A_.append(l)

t = T % l
mi = 0
ml = 0
for i in range(N):
    if A_[i] <= t < A_[i + 1]:
        mi = i
        ml = t - A_[i]
        break

print(mi + 1, ml)
