Returning Soldier Problem