102191: [AtCoder]ABC219 B - Maritozzo

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Score : $200$ points

Problem Statement

You are given three strings $S_1, S_2, S_3$ consisting of lowercase English letters, and a string $T$ consisting of 1, 2, 3.

Concatenate the three strings according to the characters in $T$ and print the resulting string. Formally, conform to the following instructions.

  • For each integer $i$ such that $1 \leq i \leq |T|$, let the string $s_i$ be defined as follows:
    • $S_1$, if the $i$-th character of $T$ is 1;
    • $S_2$, if the $i$-th character of $T$ is 2;
    • $S_3$, if the $i$-th character of $T$ is 3.
  • Concatenate the strings $s_1, s_2, \dots, s_{|T|}$ in this order and print the resulting string.

Constraints

  • $1 \leq |S_1|, |S_2|, |S_3| \leq 10$
  • $1 \leq |T| \leq 1000$
  • $S_1$, $S_2$, and $S_3$ consist of lowercase English letters.
  • $T$ consists of 1, 2, and 3.

Input

Input is given from Standard Input in the following format:

$S_1$
$S_2$
$S_3$
$T$

Output

Print the answer.


Sample Input 1

mari
to
zzo
1321

Sample Output 1

marizzotomari

We have $s_1 = $ mari, $s_2 = $ zzo, $s_3 = $ to, $s_4 = $ 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

Input

题意翻译

给你三个字符串,第 $i$ 个字符串代号为 $i$。现在给你一个代号串,请你根据代号串里的代号拼接字符串并输出(无空格)

Output

得分:200分 部分 问题描述 你将得到三个由小写英文字母组成的字符串 $S_1, S_2, S_3$,以及一个由数字 1, 2, 3 组成的字符串 $T$。 根据 $T$ 中的字符将这三个字符串拼接起来并打印结果字符串。具体来说,按照以下说明进行操作。 1. 对于每个满足 $1 \leq i \leq |T|$ 的整数 $i$,定义字符串 $s_i$ 如下: * 如果 $T$ 的第 $i$ 个字符为 1,则 $s_i = S_1$; * 如果 $T$ 的第 $i$ 个字符为 2,则 $s_i = S_2$; * 如果 $T$ 的第 $i$ 个字符为 3,则 $s_i = S_3$。 2. 按照这个顺序将字符串 $s_1, s_2, \dots, s_{|T|}$ 拼接起来并打印结果字符串。 部分 约束条件 * $1 \leq |S_1|, |S_2|, |S_3| \leq 10$ * $1 \leq |T| \leq 1000$ * $S_1$、$S_2$ 和 $S_3$ 由小写英文字母组成。 * $T$ 由数字 1, 2, 3 组成。 部分 输入 输入通过标准输入给出以下格式: ``` $S_1$ $S_2$ $S_3$ $T$ ``` 部分 输出 打印答案。 部分 样例输入 1 ``` mari to zzo 1321 ``` 部分 样例输出 1 ``` marizzotomari ``` 我们有 $s_1 = $ mari,$s_2 = $ zzo,$s_3 = $ to,$s_4 = $ mari。将这些字符串拼接起来并打印结果字符串:marizzotomari。 部分 样例输入 2 ``` abra cad abra 123 ``` 部分 样例输出 2 ``` abracadabra ```

加入题单

算法标签: