you give matrix size n time n fill lowercase english letter you change k letter matrixConsider path upper left corner low right corner cell neighboring cell right each path associate string form letter cell path visit thus length string 2n 1find lexicographically small string associate path change letter k cell matrixa stre lexicographically small string b different letter b small