The lead game

Please help in what I am doing wrong here?

https://www.codechef.com/viewsolution/41811774

elif ts2>ts2 this is your mistake
ts2>ts2