codechef didn't like this one because it took too long, but there have been NO successful python 3 submissions so I'm not too worried about that. There have been successful python 2 submissions but they all took twice as long as codechef says the timelimit is so I'm not going to fight with it any further.