find the direction codechef solution