number = str(input())
list_number = [n for n in number]
print(int(list_number[-1]) + int(number[-2]))
number = str(input())
list_number = [n for n in number]
print(int(list_number[-1]) + int(number[-2]))