The program is run via the sequence of commands: (clear)(load "...")(reset)(assert spoj-non-interactive)(run). Don't make any assumptions about the strategy of inferrence (it is currently DFS, but subject to change to BFS at any moment).
(assert (number (read)))
?f<-(number ?n)(test (<> ?n 42))
(printout t ?n crlf)