Viterbi ALgorithm work.