This is simple math question.
Solution:
apoints = af*3 + as*2 + at
bpoints = bf*3 + bs*2 + bt
apoints > bpoints , print A
apoints < bpoints , print B
apoints = bpoints , print T
def whowin(a, b):
suma = 3*a[0] + 2*a[1] + a[2]
sumb = 3*b[0] + 2*b[1] + b[2]
if suma == sumb:
print("T")
elif suma > sumb:
print("A")
else:
print("B")
A = []
B = []
for i in range(3):
S = input().rstrip().split()
A.append(int(S[0]))
for i in range(3):
S = input().rstrip().split()
B.append(int(S[0]))
whowin(A, B)
Comentários