Условие:

6460 + 8
50140
97790

6460 + 8 = 4 + 8 = 12
50140 = 4940 = 9
97790 = 9090 = 0