No runtime error anymore!
The class should have been named Main
Also changed the reader to buffered reader to avoid I/O overhead.

Currently it gives time limit error