EOF error while reading input

n,q=input().split()
n=int(n)
q=int(q)
while n>0:
a=list(map(int,input().split()))
b=list(map(int,input().split()))

I am entering this code to input two arrays i.e. a and b. I have tried all sorts of inputting an array by googling all options but I am getting EOF while reading line error every single time. I am unable to understand why. Please help. Thanks in advance!