So what have you tried now?
Is there something wrong with your code?
If you have code paste it here and ask specific questions like "why it prints exception", or "why the output is wrong".