Your output method is fine. SPOJ doesn't usually care about white space in the output unlike some other judges.
Your assumption that there are other test cases is correct. Your code should correctly handle every input that matches the input constraints given in the problem statement. Please note that you don't have to verify that the input constraints are correct. If they are wrong there will typically be plenty of comments below the problem stating this.
Please don't hesitate to post back if you have more questions. A useful piece of information is the problem code when posting any topic. It makes it easier for us to know what you're talking about.
Cheers,
Leppy