Implement hasNext().
Rename FastScanner to FastReader.
Implement nextPermutation for Java.