Description
Time Limit: 2 sec / Memory Limit: 1024 MB
Score : 200200 points
Problem Statement
You are given three strings
S_1, S_2, S_3S1,S2,S3 consisting of lowercase English letters, and a string
TT consisting of 1, 2, 3.
Concatenate the three strings according to the characters in
TT and print the resulting string. Formally, conform to the following instructions.
-
For each integer ii such that 1 \leq i \leq |T|1≤i≤∣T∣, let the string s_isi be defined as follows:
-
S_1S1, if the ii-th character of TT is 1;
-
S_2S2, if the ii-th character of TT is 2;
-
S_3S3, if the ii-th character of TT is 3.
-
Concatenate the strings s_1, s_2, \dots, s_{|T|}s1,s2,…,s∣T∣ in this order and print the resulting string.
Constraints
-
1 \leq |S_1|, |S_2|, |S_3| \leq 101≤∣S1∣,∣S2∣,∣S3∣≤10
-
1 \leq |T| \leq 10001≤∣T∣≤1000
-
S_1S1, S_2S2, and S_3S3 consist of lowercase English letters.
-
TT consists of 1, 2, and 3.
Input
Input is given from Standard Input in the following format:
S_1S1S_2S2S_3S3TT
Output
Print the answer.
HINT
We have s_1 =s1= mari, s_2 =s2= zzo, s_3 =s3= to, s_4 =s4= mari. Concatenate these and print the resulting string: marizzotomari.