#C8879. Replace Stars
Replace Stars
Replace Stars
You are given a string consisting of lowercase letters and the special character '' (asterisk). For each occurrence of '', replace it with any letter from 'a' to 'z'. Your task is to generate all possible strings obtained by replacing every '*' with a lowercase letter such that the resulting list is in lexicographical order.
For instance, given the input string "ab*de", the output should be all strings of the form "abXde" where X is any letter between 'a' and 'z', sorted lexicographically.
In mathematical notation, if the input string has k asterisks, then there are (26^k) possible outputs.
Note: The input and output are handled via standard input (stdin) and standard output (stdout).
inputFormat
The input consists of a single line containing a string. The string consists of lowercase letters and zero or more '*' characters.
outputFormat
Output all possible strings obtained by replacing each '*' with a lowercase letter. Each string should be printed on a new line in lexicographical order.## sample
abc
abc