题号:NC237554
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 512 M,其他语言1024 M
64bit IO Format: %lld
题目描述
Lucy has one cube folded from paper .
For example ,the paper below can be folded into the cube on the right .
The opposite side of

is

, opposite side of

is

, and opposite side of

is

.
Now Clare has another cube folded from paper too .
Please help them determine whether their cubes are isomorphic .
Two cubes are isomorphic when :
For each number
)
, the number on the opposite side of the two cubes are same .
输入描述:
There are two parts to describe the cubes .
Each part has exactly
lines , and each line has
integers , separated by white space .
Number
indicates that this position is part of the cube , and the number on it is
,
indicates it's not part of the cube .
It is guaranteed that for each cube , each number from
to
will appear exactly once , and the paper can form a cube .
输出描述:
If the two cubes are isomorphic , print "YES'' , otherwise print "NO'' .
示例1
输入
复制
0 0 0 4
3 6 1 2
5 0 0 0
0 0 4 0
6 3 5 0
0 0 2 1
示例2
输入
复制
3 0 0 0
1 5 6 2
0 0 4 0
5 0 0 0
3 1 4 6
0 0 0 2
说明
For each cube , the non-zero position in the input must meet one of the following conditions .
备注:
For each cube , the non-zero position in the input must meet one of the following conditions .