What's wrong in this code?

2
9 9
2
9 9

for this input your ouput is
9, 8, END
but correct output is 1, 9, 8, END