시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 128 MB 26 7 4 57.143%

문제

2344번 거울의 출력이 입력으로 주어졌을 때, 원래의 입력을 구하는 프로그램을 작성하시오. 즉, 거울의 각 구멍에서 쏜 빛이 나가는 구멍의 번호들이 주어졌을 때, 상자의 모양을 구해 내는 문제이다. 항상 답이 존재하는 경우만 주어진다.

입력

첫째 줄에 N, M (1≤N, M≤100)이 주어진다. 다음 줄에는 2N+2M개의 수들이 주어진다.

출력

N개의 줄에 M개의 수로 상자의 모양을 출력한다. 답이 여러 가지 존재할 경우 아무 것이나 출력하면 된다.

예제 입력 1

2 3
9 7 10 8 6 5 2 4 1 3

예제 출력 1

0 1 0
0 1 1
W3sicHJvYmxlbV9pZCI6IjIzNDciLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWFjNzBcdWM2YjgyIiwiZGVzY3JpcHRpb24iOiI8cD4yMzQ0XHViYzg4IFx1YWM3MFx1YzZiOFx1Yzc1OCBcdWNkOWNcdWI4MjVcdWM3NzQgXHVjNzg1XHViODI1XHVjNzNjXHViODVjIFx1YzhmY1x1YzViNFx1Yzg0Y1x1Yzc0NCBcdWI1NGMsIFx1YzZkMFx1Yjc5OFx1Yzc1OCBcdWM3ODVcdWI4MjVcdWM3NDQgXHVhZDZjXHVkNTU4XHViMjk0IFx1ZDUwNFx1Yjg1Y1x1YWRmOFx1YjdhOFx1Yzc0NCBcdWM3OTFcdWMxMzFcdWQ1NThcdWMyZGNcdWM2MjQuJm5ic3A7XHVjOTg5LCBcdWFjNzBcdWM2YjhcdWM3NTggXHVhYzAxIFx1YWQ2Y1x1YmE0ZFx1YzVkMFx1YzExYyBcdWMzZGMgXHViZTViXHVjNzc0IFx1YjA5OFx1YWMwMFx1YjI5NCBcdWFkNmNcdWJhNGRcdWM3NTggXHViYzg4XHVkNjM4XHViNGU0XHVjNzc0IFx1YzhmY1x1YzViNFx1Yzg0Y1x1Yzc0NCBcdWI1NGMsIFx1Yz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