def add (numStr1,numStr2):
l1 = len(numStr1)
l2 = len(numStr2)
if l1 == 0 or l2 == 0:
return
if l1 == l2 and numStr1[0] != '-' and numStr2[0] != '-':
bottomRow = [0 for count in range(0,l1 + 1)]
endIdx = l1 - 1
while endIdx >= 0:
oneAdd = int(numStr1[endIdx]) + int(numStr2[endIdx])
bottomRow[endIdx + 1] += oneAdd % 10
if oneAdd > 9:
oneAdd = int(oneAdd / 10)
bottomRow[endIdx] = oneAdd
endIdx -= 1
if bottomRow[0] == 0:
bottomRow = [str(n) for n in bottomRow[1:]]
else:
bottomRow = [str(n) for n in bottomRow]
resultStr = ''.join(bottomRow)
return resultStr
elif l1 == l2 and numStr1[0] == '-' and numStr2[0] == '-':
resultStr = add(numStr1[1:],numStr2[1:])
resultStr = '-' + resultStr
return resultStr
elif l1 > l2 and numStr1[0] != '-' and numStr2[0] != '-':
sub = l1 - l2
numStr2 = list(numStr2)
numStr2 = ['0']*sub + numStr2
numStr2 = ''.join(numStr2)
endIdx = l1 - 1
bottomRow = [0 for count in range(0,l1 + 1)]
while endIdx >= sub:
oneAdd = int(numStr1[endIdx]) + int(numStr2[endIdx])
bottomRow[endIdx + 1] += oneAdd % 10
if oneAdd > 9:
oneAdd = int(oneAdd / 10)
bottomRow[endIdx] += oneAdd
endIdx -= 1
while endIdx >= 0:
oneAdd = bottomRow[endIdx + 1] + int(numStr1[endIdx])
bottomRow[endIdx + 1] = oneAdd % 10
if oneAdd > 9:
oneAdd = int(oneAdd / 10)
bottomRow[endIdx] += oneAdd
else:
while endIdx >= 0:
bottomRow[endIdx + 1] = numStr1[endIdx]
endIdx -= 1
continue
endIdx -= 1
if bottomRow[0] == 0:
bottomRow = bottomRow[1:]
bottomRow = [str(n) for n in bottomRow]
resultStr = ''.join(bottomRow)
return resultStr
elif l1 < l2 and numStr1[0] != '-' and numStr2[0] != '-':
return add(numStr2,numStr1)
elif l1 > l2 and numStr1[0] == '-' and numStr2[0] == '-':
return '-' + add(numStr1[1:],numStr2[1:])
elif l1 < l2 and numStr1[0] == '-' and numStr2[0] == '-':
return '-' + add(numStr1[1:],numStr2[1:])
elif l1 > l2 - 1 and numStr1[0] != '-' and numStr2[0] == '-':
numStr2 = numStr2[1:]
l2 = len(numStr2)
sub = l1 - l2
numStr2 = list(numStr2)
numStr2 = ['0']*sub + numStr2
numStr2 = ''.join(numStr2)
endIdx = l1 - 1
bottomRow = [0 for count in range(0,l1)]
while endIdx >= sub:
oneSub = int(numStr1[endIdx]) - int(numStr2[endIdx])
if oneSub >= 0:
bottomRow[endIdx] += oneSub
else:
oneSub = 10 + oneSub
bottomRow[endIdx] += oneSub
endi = endIdx - 1
numStr1 = list(numStr1)
while numStr1[endi] == '0':
numStr1[endi] = '9'
endi -= 1
else:
numStr1[endi] = str(int(numStr1[endi]) - 1)
numStr1 = ''.join(numStr1)
endIdx -= 1
while endIdx >= 0:
if numStr1[endIdx] != 0:
bottomRow[endIdx] += int(numStr1[endIdx])
endIdx -= 1
cutTo = 0
for n in bottomRow:
if n == 0:
cutTo += 1
else:
break
bottomRow = bottomRow[cutTo:]
resultStr = [str(n) for n in bottomRow]
resultStr = ''.join(resultStr)
return resultStr
elif l1 - 1 < l2 and numStr1[0] == '-' and numStr2[0] != '-':
return add(numStr2,numStr1)
elif l1 == (l2 - 1) and numStr1[0] != '-' and numStr2[0] == '-':
numStr2 = numStr2[1:]
return int(numStr1) - int(numStr2)
elif (l1 - 1) == l2 and numStr1[0] == '-' and numStr2[0] != '-' and False:
return int(numStr1) + int(numStr2)
elif str(int(numStr1)) != numStr1 and str(int(numStr2)) != numStr2:
return int(numStr1) + int(numStr2)
elif False:
return int(numStr1) + int(numStr2)
else:
return int(numStr1) % int(numStr2)
two = input().split(' ')
print(add(two[0],two[1]))