Welcome to codechef!
Here you are supposed to solve problems by writing code. And if you know the input and output as well, do you really need to code? Your code is supposed to take arbitrary input through standard input (STDIN), solve the problem and produce output on standard output (STDOUT).
Now what you type through keyboard is STDIN, and what you see on the screen is STDOUT.
What you have coded is not solving the problem. Read the problem statement carefully. It says ->
rewrite small numbers from input to
output. Stop processing input after
reading in the number 42.
So what you need to do is, run a loop, which accepts integer as input. Checks if it is 42. If yes, finish the program, otherwise print the number, and continue in the loop.
For more clarity->
1, 2, 88, 42, 99 are for example only. This is not what your code will be run against. They are there just to ensure you understand the problem. So instead of storing them in list, you need to read the input.
While this is the easiest problem, and I (or anyone) can give you the code, it is better if you come up with solution yourself.
EDIT - Whenever you are unable to solve any problem, re-read the problem carefully again and again, until you understand it. The problem statement says to stop on 42, and not 48. Also you are supposed to print all the numbers, read prior to 42.