great exercise:
a fast version;

two different compare mechanism about small and big number.

use bufferedRead to read string fast.