class Solution:
def isSumEqual(self, firstWord: str, secondWord: str, targetWord: str) -> bool:
def f(word):
res = 0
for i in word:
res *= 10
res += ord(i) - ord('a')
return res
return f(firstWord) + f(secondWord) == f(targetWord)