시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 72 16 15 30.612%

문제

매직 스퀘어는 3×3개의 작은 사각형으로 이루어져 있고, 각 사각형의 안에는 20,000보다 작거나 같은 양의 정수가 있다.

매직 스퀘어는 각각의 행과 열, 두 대각선에 쓰여 있는 수의 합이 모두 같다.

상근이도 매직 스퀘어를 만들었다. 하지만, 창영이가 일부 숫자를 지우개로 지워버렸다. 창영이는 착하기 때문에 숫자를 많아야 세 개만 지웠다.

일부 숫자가 지워진 매직 스퀘어가 주어졌을 때, 지워져 있는 숫자를 채우는 프로그램을 작성하시오.

입력

총 세 개의 줄에 매직 스퀘어를 이루는 세 개의 숫자가 주어진다. 지워진 숫자는 0으로 주어진다.

출력

지워진 숫자를 채운 매직 스퀘어를 출력한다.

예제 입력 1

4 9 2
3 0 7
8 1 6

예제 출력 1

4 9 2
3 5 7
8 1 6
W3sicHJvYmxlbV9pZCI6IjMxOTIiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWI5ZTRcdWM5YzEgXHVjMmE0XHVkMDE4XHVjNWI0IiwiZGVzY3JpcHRpb24iOiI8cD5cdWI5ZTRcdWM5YzEgXHVjMmE0XHVkMDE4XHVjNWI0XHViMjk0IDMmdGltZXM7M1x1YWMxY1x1Yzc1OCBcdWM3OTFcdWM3NDAgXHVjMGFjXHVhYzAxXHVkNjE1XHVjNzNjXHViODVjIFx1Yzc3NFx1YjhlOFx1YzViNFx1YzgzOCBcdWM3ODhcdWFjZTAsIFx1YWMwMSBcdWMwYWNcdWFjMDFcdWQ2MTVcdWM3NTggXHVjNTQ4XHVjNWQwXHViMjk0IDIwLDAwMFx1YmNmNFx1YjJlNCBcdWM3OTFcdWFjNzBcdWIwOTggXHVhYzE5XHVjNzQwIFx1YzU5MVx1Yzc1OCBcdWM4MTVcdWMyMThcdWFjMDAgXHVjNzg4XHViMmU0LjxcL3A+XHJcblxyXG48cD5cdWI5ZTRcdWM5YzEgXHVjMmE0X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