A better solution for PAT 1012, to rank
change file directory