# getting Runtime error

t = int(input())
o = []
def sum(s):
return s[0] + s[1] + s[2]

def check(S1, S2, S3):
if S1[0]>=S2[0] and S1[0]>=S3[0] and S1[1]>=S2[1] and S1[1]>=S3[1] and S1[2]>=S2[2] and S1[2]>=S3[2]:
if (S1[0] > S2[0] or S1[1] > S2[1] or S1[2] > S2[2]) and S1[0] > S3[0] or S1[2] > S3[2] or S1[1] > S3[1]:
o.append(“yes”)
else:
o.append(“no”)

while t:
s1 = input()
s2 = input()
s3 = input()
S1 = [0, 0, 0]
S2 = [0, 0, 0]
S3 = [0, 0, 0]
S1[0], S1[1], S1[2] = int(s1[0]),int(s1[2]),int(s1[4])
S2[0], S2[1], S2[2] = int(s2[0]),int(s2[2]),int(s2[4])
S3[0], S3[1], S3[2] = int(s3[0]),int(s3[2]),int(s3[4])

``````sums = []
su1 = sum(S1)
su2 = sum(S2)
su3 = sum(S3)
sums.append(su1)
sums.append(su2)
sums.append(su3)
sums.sort()

if su1 == sums[2]:
check(S1, S2, S3)
elif su2 == sums[2]:
check(S2, S1, S3)
elif su3 == sums[2]:
check(S3, S2, S1)
t = t -1
``````

for x in o:
print(x)

I am getting runtime error when submitting on codechef although it runs well on pycharm’s ide. plz help.
It is solution to Ordering teams prob in Practice(Beg)