Given a number, replace its digits with corresponding characters in given list and print all strings possible. Same character should be considered for every occurrence of a digit in the number. Input number is positive and doesn’t contain 0.

The idea is for each digit in the input number, we consider strings formed by previous digit and append characters mapped to current digit to them. If this is not the first occurrence of the digit, we append same character as used in its first occurrence.