ab=(eval(input()))

a_,b_=ab.split()

a=int(a_)

b=int(b_)



if a+b>24:

    print((a+b-24))

elif a+b==24:

    print("0")

        

else:

    print((a+b))
A,B =list(map(int,input().split()))



if A+B>=24:

    print((A+B-24))



else:

    print((A+B))
ab = eval(input())
a_, b_ = ab.split()
a = int(a_)
b = int(b_)
if a + b > 24:
    print((a + b - 24))
elif a + b == 24:
    print("0")
else:
    print((a + b))

A, B = list(map(int, input().split()))
if A + B >= 24:
    print((A + B - 24))
else:
    print((A + B))

-ab = eval(input()) -a_, b_ = ab.split() -a = int(a_) -b = int(b_) -if a + b > 24: -    print((a + b - 24)) -elif a + b == 24: -    print("0") +A, B = list(map(int, input().split())) +if A + B >= 24: +    print((A + B - 24)) -    print((a + b)) +    print((A + B))