Given a string composed of characters from '' to '', and an array of transformations called conversions. Each element in conversions follows the format "s_1-s_2", where s_1 and s_2 are strings of characters ''..''.
To obtain the resulting string from string , you must process each element of the conversions array in order, from the first to the last. For each element "s_1-s_2", perform the following actions:
If the string contains at least one occurrence of s_1 as a substring, replace the first (leftmost) occurrence of s_1 in with s_2.
If does not contain s_1 as a substring, append s_2 to the end of .
The first line contains the string . The second line contains the number , representing the number of elements in the conversions array. The subsequent lines list the elements of the conversions array.
The string consists of from to characters, each being ''..''. The conversions array contains from to elements. Each element in the conversions array is formatted as "s_1-s_2", where s_1 and s_2 are strings of to characters, each being ''..''.
Output the string that represents the resulting code.
Example 1