Code Problem in taking inputs

Why does it say input() returned EOF in the following code:

N = int(input())
arr = {}

for i in range(N):
temp = input()
if temp in arr:
arr[temp] = arr[temp]+1
else:
arr[temp] = 1

for x,y in arr.items():
if y >= math.floor(N/3):
print(x," ",)

Hey @dev.sagarkhatri in this code while taking input you are getting EOF? Is this what you mean?

Actually the input is not in this format

8
2 
2 
3 
1 
3 
2 
1 
1 

Your code will work for this type of input(although the logic is not right)

So keep the input format and logic in your mind before proceeding this question.
As input is of format:
8
2 2 3 1 3 2 1 1

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.