complete ThirdGreatest.js