I run my code on IntellJ and creat two text file for test and the code just runs well. However, when I submit the code on the website, it says that I have infinite loop. So strange...