Find all possible combinations by replacing given digits with characters of the corresponding list
Given n lists of characters and a number whose digits lie between 1 and n, print all possible combinations by replacing its digits with the characters of the corresponding list.