#abc219b. [abc219_b]Maritozzo
[abc219_b]Maritozzo
Problem Statement
You are given three strings consisting of lowercase English letters, and a string consisting of 1
, 2
, 3
.
Concatenate the three strings according to the characters in and print the resulting string. Formally, conform to the following instructions.
- For each integer such that , let the string be defined as follows:
- , if the -th character of is
1
; - , if the -th character of is
2
; - , if the -th character of is
3
.
- , if the -th character of is
- Concatenate the strings in this order and print the resulting string.
Constraints
- , , and consist of lowercase English letters.
- consists of
1
,2
, and3
.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
mari
to
zzo
1321
Sample Output 1
marizzotomari
We have mari
, zzo
, to
, mari
. Concatenate these and print the resulting string: marizzotomari
.
Sample Input 2
abra
cad
abra
123
Sample Output 2
abracadabra
Sample Input 3
a
b
c
1
Sample Output 3
a