-->
当前位置:首页 > 题库

PROGRAMMING:% of LC

Luz5年前 (2021-05-10)题库466
open
Topic background
LC has a 3-level cube and a face has 9 squares.
Because LC has a magic% method, it can convert one side of the Rubik's cube into characters and save them.
LC would like to know how many people will use this% method?
The specification of Rubik's cube is 6 \ * 6, and each square is 2 \ * 2 (2 \ * 2 \ * 9 = = 6 \ * 6) with 9 digits a1-a9 in a row. AI represents the color type of the i-th square from left to right and from top to bottom (1 < = AI < = 6);
The last line contains six characters Bi, which represents the corresponding characters of each color type;
Now you need to save the Rubik's cube in characters and rotate it 270 degrees clockwise °



### Input format:
Each test sample has t sets of data
The first line T represents T group data
Each group
The first line, 9 numbers A1 ~ A9, represents the color of the square
In the second line, six numbers B1 ~ B6 represent the characters corresponding to the color
###Output format:
For each group of data
Output the result of converting the color to the corresponding character (no extra space at the end)
Each group of data is divided by newline
###Input example:
```in
one
1 1 2 2 3 3 4 5 6
ABCDEF
```
###Output example:
```out
BBCCFF
BBCCFF
AACCEE
AACCEE
AABBDD
AABBDD
```
###Input example:
```in
two
3 3 1 6 2 2 1 2 4
mszvwI
3 6 6 4 3 6 2 1 6
yblJqN
```
###Output example:
```out
mmssvv
mmssvv
zzssss
zzssss
zzIImm
zzIImm
NNNNNN
NNNNNN
NNllyy
NNllyy
llJJbb
llJJbb
```
###Tips
For example 1, we have such a cube rotation
![ Magic cube. PNG] (~ / c6b7c926-060b-4e79-8098-46f1f50f9d23. PNG)
If the format is wrong, remember that there is no extra space at the end, as well as the newline







answer:If there is no answer, please comment