a=input().split(' ')

b=input().split(' ')
time=0
for i in range():
    for i in b:
        time+=b
    if time<=a[1]:
        print(time)
    elif time>a[1]:
        time=(a[1]-time)+time
        print(time)
        







    
    