In the "reading program writing results" issue of the popularity group in the preliminary round, we gave an example of string expansion: If in the input string, it contains a string similar to "d-h" or "4-8", and we use it as a short name. when outputting, we use a progressively increasing letter to get a number string to replace the minus sign, that is, the two substrings are output as "defgh" and "45678" respectively ". In this question, we add some parameter settings to make the expansion of strings more flexible. The specific conventions are as follows:
(1) In the following situations, expand the string: In the input string, the minus sign "-" appears, and both sides of the minus sign are lowercase letters or numbers, in the ASCII order, the characters on the right of the minus sign must be greater than those on the left.
(2) parameter p1: expansion mode. When p1 = 1, lowercase letters are entered for letters and substrings; When p1 = 2, uppercase letters are entered for letters and substrings. In both cases, the number substrings are filled in the same way. When p1 = 3, whether it is a letter or a number string, it is filled with an asterisk (*) with the same number of letters to be filled.
(3) parameter p2: number of repeated characters filled in. P2 = k indicates that the same character must be continuously filled with k characters. For example, when p2 is 3, the substring "d-h" should be extended to "deeefffgggh ". The characters on both sides of the minus sign remain unchanged.
(4) Whether to change the p3 parameter to backward order: p3 = 1 indicates that the original order is maintained, and p3 = 2 indicates that the output is in reverse order. Note that the characters at both ends of the minus sign are not included at this time. For example, when p1 = 1, p2 = 2, and p3 = 2, the substring "d-h" should be extended to "dggffeeh ".
(5) If the character on the right of the minus sign is the successor of the character on the left, only the minus sign in the middle is deleted. For example, "d-e" should be output as "de ", "3-4" should be output as "34 ". If the characters on the right of the minus sign are less than or equal to the characters on the left in the ASCII code order, the minus signs in the middle should be retained during output. For example: "d-d" should be output as "d-d", and "3-1" should be output as "3-1 ".