I'm almost certain you were getting an EOF error because you were asking for too much input. My code works for me. Best of luck.
9.4m questions
12.2m answers