you give simple undirected graph n vertex n you go write letter vertex each letter k letter Latin alphabeta path graph call hamiltonian visit vertex exactly a string call palindromic read leave right right leave a path graph call palindromic letter vertex spell palindromic string change ordera string length n good letter k lowercase Latin letter write ith letter string ith vertex graph exist palindromic hamiltonian path graph Note path do not necesserily vertice order 1 2 dot ncount number good string