Coding Challenge: Kattis
making your code harder to read:


lack of docstrings
lack of comments
unwarranted indentation using an else: after a "disruptive if" 
(transferring execution with return, break, continue)
(Here, you are using this with otherwise empty "if-parts":
you could negate the conditions and just use the former else:-statements. Hello again, indentation.)