I can able to run in Intellij. the output is correct.