D. MasterChef
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
Example
Input
3
1 2 3
1 3 4
1 4 5
Output
YES
0 1 1
1 0 0
0 1 1