시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 512 MB 1 1 1 100.000%

문제

It is well known that a set of six unit squares that are attached together in a “cross” can be folded into a cube.

But what about other initial shapes? That is, given six unit squares that are attached together along some of their sides, can we form a unit cube by folding this arrangement?

입력

Input consists of 6 lines each containing 6 characters, describing the initial arrangement of unit squares. Each character is either a ., meaning it is empty, or a # meaning it is a unit square.

There are precisely 6 occurrences of # indicating the unit squares. These form a connected component, meaning it is possible to reach any # from any other # without touching a . by making only horizontal and vertical movements. Furthermore, there is no 2 × 2 subsquare consisting of only #. That is, the pattern

##
##

does not appear in the input.

출력

If you can fold the unit squares into a cube, display can fold. Otherwise display cannot fold.

예제 입력 1

......
......
######
......
......
......

예제 출력 1

cannot fold

예제 입력 2

......
#.....
####..
#.....
......
......

예제 출력 2

can fold

예제 입력 3

..##..
...#..
..##..
...#..
......
......

예제 출력 3

cannot fold

예제 입력 4

......
...#..
...#..
..###.
..#...
......

예제 출력 4

can fold