it's not impossible to solve, but there are situations like that which make any solution not work, which was a follow up question
If the input is infinite and unordered and the task is to produce output in order, how do you know when it’s OK to start writing output?