Same solution. WA in python 3, AC in python 2.7

Question link:


Solution link of AC in python 2.7
http://www.codechef.com/viewsolution/4942649
Solution link of WA in python 3.1
http://www.codechef.com/viewsolution/4942676

What the error? Only difference is I/O.