Using Java probable prime function is probably wrong!
If you happen to still be having trouble solving this problem,
It is very rare that white space in the output causes issue. It is more frequent that white space in the input and a strict input method may cause issue, but that is not the case in this problem.