Because you were not providing any input.
1 2 3 4 3 4
I forked your code with this as stdin, and there was no runtime error.
If this is attempt to ask as short question as possible, you can replace “RUNTIME error” with RE.
I recommend you to ask as clear questions as possible instead of as short as possible
He is already fed up with the error in his code, and now he has got an error in his question!