Decree of the Wise Leader
The chief of the Yavgustab tribe, whose members call themselves Yavgustohutoratsi, recently received a peculiar device—a typewriter. The chief, known as the Prudent Manul, wisely entrusted it to his scribe, a young Indian named Crooked Feather, so that the tribe could finally understand what Crooked Feather had written in the chief's decrees.
This typewriter is quite complex. It features 26 keys, each corresponding to a lowercase Latin letter. The keys are arranged in three rows: 10 keys in the first row, 9 in the second, and 7 in the third. Each row's keys are numbered from left to right, starting at one. Additionally, each key is directly above the key in the next row with the same number. The typewriter lacks keys for any characters other than lowercase Latin letters, including spaces, so Crooked Feather must type all the words of the decree together.
Initially, Crooked Feather often missed the intended key, accidentally pressing adjacent keys—above, below, left, right, above-right, below-right, above-left, or below-left.
Moreover, Crooked Feather was unsure of the correct order for entering letters, so he typed the letters of the phrase randomly. For instance, instead of typing "helloworld", he might type "oldhellrow" (assuming he doesn't miss any keys).
One day, for the first time, Crooked Feather typed the chief's decree on the typewriter instead of using a feather. Naturally, there were mistakes and the letters were in random order. Help the Yavgustohutoratsi decipher what the prudent chief intended to say. Consider these points: Firstly, the chief wisely ordered that Crooked Feather type the decree under the supervision of the shaman Sharp Eye, ensuring Crooked Feather missed the intended key no more than N times while typing (though the letters were still in random order). Secondly, after attending a shaman ritual of the Tarskija tribe as an honorary guest, the Prudent Manul became fascinated with their sacred lexicographical order and began dictating decrees to be as lexicographically minimal as possible. The residents wish to know the lexicographically smallest string that could have been in the chief's decree.
Input
The first three lines of the input specify the arrangement of the typewriter keys—three lines containing lowercase Latin letters, with lengths of 10, 9, and 7 characters, respectively. The fourth line contains the text of the chief's decree, typed by Crooked Feather and therefore containing mistakes—a non-empty string consisting only of lowercase Latin letters, with a length not exceeding 5·10^4. The fifth line records the number N (0 ≤ N ≤ 5·10^4)—the maximum number of letters Crooked Feather could have typed incorrectly.
Output
Output the lexicographically smallest string that could have been the Prudent chief's decree.