Print lcs dynamic programming

how to print?
what logic should be used for printing