시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 256 MB 38 27 26 74.286%

문제

당신은 정보 보안 회사의 직원이다. 최근 당신의 한 고객이 새로운 프로그램을 개발했는데, 이 프로그램은 사용 대상이 사람인지 프로그램인지의 여부를 판정해준다. 당신의 임무는 이 프로그램의 효율성을 테스트하는 것이다.

테스트는 유명 보드게임 '배틀쉽' 의 변형판을 이용한다. 이 게임은 10 * 10 크기로 나눠진 격자판 보드에서 진행된다. 게임을 시작하기 전, 당신은 한 칸 크기의 전함 4척, 두 칸 크기의 전함 3척, 세 칸 크기의 전함 2척, 네 칸 크기의 전함 1척, 총 10척의 우주 전함을 보드 위에 배치해야 한다. 각 전함은 수직 혹은 수평으로 이어진 칸들의 연속된 집합 위에 놓을 수 있다. 어떤 두 전함도 좌우, 상하, 대각선으로 인접할 수 없으며, 당연히 어떤 칸을 공유할 수도 없다.

보드를 세팅한 뒤, 몇 라운드를 거쳐 테스트를 진행하게 된다. 각 라운드에서 단 하나의 칸을 마음대로 골라 그 칸을 향해 발포할 수 있고, 만일 어떤 전함이 놓인 모든 칸에 한 번 이상의 타격을 입었다면 그 전함은 침몰하게 된다. 모든 전함이 침몰한 뒤에 게임은 끝난다.

당신은 이 게임의 '복잡도' 를 게임이 끝나기까지 진행된 라운드의 수로 정의하고, 만일 사람이 게임을 진행한다면 프로그램이 진행할 때보다 게임이 더 복잡해질 것이라고 가정하여 테스트를 진행하기로 했다.

당신은 이미 어떤 칸을 향해 발포할지 정해 두었다. 이 목록에선 같은 칸에 두 번 발포하지 않는다. 이제 당신은 게임을 가능한 한 가장 복잡하게 만드는 보드의 초기 상태를 구하는 프로그램을 작성하면 된다.

입력

열 개의 정수가 열 개의 줄에 걸쳐 입력된다.

각각의 정수는 몇 번째 순서로 그 칸에 발포할지를 나타내며, 1 이상 100 이하의 값을 갖는다.

출력

게임을 가장 오래 가게 만드는 보드의 초기 상태를 열 줄에 걸쳐 출력한다.

빈 칸엔 '.'을, 전함이 놓인 자리엔 '#'을 출력하면 된다.

예제 입력 1

1 2 3 4 5 6 7 8 9 10
36 37 38 39 40 41 42 43 44 11
35 64 65 66 67 68 69 70 45 12
34 63 84 85 86 87 88 71 46 13
33 62 83 96 97 98 89 72 47 14
32 61 82 95 100 99 90 73 48 15
31 60 81 94 93 92 91 74 49 16
30 59 80 79 78 77 76 75 50 17
29 58 57 56 55 54 53 52 51 18
28 27 26 25 24 23 22 21 20 19

예제 출력 1

...####...
..........
#....##...
#.#.....#.
........#.
...###....
.#........
........#.
..#.....#.
.....#..#.
W3sicHJvYmxlbV9pZCI6Ijc3NzEiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWJjMzBcdWQyYzBcdWMyN2QiLCJkZXNjcmlwdGlvbiI6IjxwPlx1YjJmOVx1YzJlMFx1Yzc0MCBcdWM4MTVcdWJjZjQgXHViY2Y0XHVjNTQ4IFx1ZDY4Y1x1YzBhY1x1Yzc1OCBcdWM5YzFcdWM2ZDBcdWM3NzRcdWIyZTQuIFx1Y2Q1Y1x1YWRmYyBcdWIyZjlcdWMyZTBcdWM3NTgmbmJzcDtcdWQ1NWMgXHVhY2UwXHVhYzFkXHVjNzc0IFx1YzBjOFx1Yjg1Y1x1YzZiNCBcdWQ1MDRcdWI4NWNcdWFkZjhcdWI3YThcdWM3NDQgXHVhYzFjXHViYzFjXHVkNTg4XHViMjk0XHViMzcwLCBcdWM3NzQgXHVkNTA0XHViODVjXHVhZGY4XHViN2E4XHVjNzQwIFx1YzBhY1x1YzZhOSBcdWIzMDBcdWMwYzFcdWM3NzQmbmJzcDtcdWMwYWNcdWI3OGNcdWM3NzhcdWM5YzAgXHVkNTA0XHViODVjXHVhZGY4XHViN2E4XHVjNzc4XHVjOWMwXHVjNzU4IFx1YzVlY1x1YmQ4MFx1Yjk3YyBcdWQzMTBcdWM4MTVcdWQ1NzRcdWM5MDBcdWIyZTQuIFx1YjJmOVx1YzJlMFx1Yzc1OCBcdWM3ODRcdWJiMzRcdW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