Galactic Governments

아직 제출이 없습니다시간 제한2초메모리 제한512 MB

문제

Currently, there are nn galactic governments in the kk-dimensional cubic universe. The universe is a cube with two opposite vertices (0,,0)(0, \ldots, 0) and (C,,C)(C, \ldots, C) and sides parallel to coordinate axes. Formally, the set of points in the universe is U=(x_1,,x_k)Rk ⁣:0x_iC.U = \\{(x\_1, \ldots, x\_k) \in \mathbb{R}^k \colon 0 \le x\_i \le C\\}\text{.}

Each galactic government claims that its territory is a parallelepiped with sides parallel to coordinate axes. The ii-th government claims a parallelepiped with two opposite vertices (a_i,1,,a_i,k)(a\_{i,1}, \ldots, a\_{i,k}) and (b_i,1,,b_i,k)(b\_{i,1}, \ldots, b\_{i,k}) such that a_i,j<b_i,ja\_{i,j} < b\_{i,j} for all jj. Formally, the ii-th government claims the set of points G_i=(x_1,,x_k)U ⁣:a_i,jx_jb_i,j.G\_i = \\{(x\_1, \ldots, x\_k) \in U \colon a\_{i,j} \le x\_j \le b\_{i,j}\\}\text{.}

Note that some pieces of territory can be claimed by multiple governments.

Rick tries to find a point which is not claimed by any of the galactic governments. He has noticed that a_i,ja\_{i,j} is an integer for all ii from 11 to nn and all jj from 11 to kk. Rick knows that it implies that an unclaimed point exists if and only if there exists an unclaimed point (α_1+12,α_2+12,,α_k+12)\left(\alpha\_1 + \frac{1}{2}, \alpha\_2 + \frac{1}{2}, \ldots, \alpha\_k + \frac{1}{2}\right) where α_i\alpha\_i are all integers. Rick likes integers, so he asks you to find α_1,,α_k\alpha\_1, \ldots, \alpha\_k such that (α_1+12,α_2+12,,α_k+12)\left(\alpha\_1 + \frac{1}{2}, \alpha\_2 + \frac{1}{2}, \ldots, \alpha\_k + \frac{1}{2}\right) is a point in the universe and it does not belong in any of the G_1,,G_nG\_1, \ldots, G\_n. If there are multiple such points, Rick wants to find the lexicographically smallest one.

Point (β_1+12,,β_k+12)\left(\beta\_1 + \frac{1}{2}, \ldots, \beta\_k + \frac{1}{2}\right) is lexicographically smaller than (γ_1+12,,γ_k+12)\left(\gamma\_1 + \frac{1}{2}, \ldots, \gamma\_k + \frac{1}{2}\right) if there exists such jj (1jk1 \le j \le k) such that for all i<ji < j we have β_i=γ_i\beta\_i = \gamma\_i, and β_j<γ_j\beta\_j < \gamma\_j.

입력

The first line contains three integers nn, kk, and CC (1n181 \le n \le 18, 1k101 \le k \le 10, 1C10001 \le C \le 1000). The ii-th of the next nn lines contains 2k2 k integers: a_i,1,,a_i,k,;b_i,1,,b_i,ka\_{i,1}, \ldots, a\_{i,k}, \\; b\_{i,1}, \ldots, b\_{i,k} (0a_i,j<b_i,jC0 \le a\_{i,j} < b\_{i,j} \le C for every jj from 11 to kk).

출력

Print "NO" if all points in the universe are claimed by galactic governments. Otherwise, print "YES" on the first line, and on the second line, print kk integers α_1,,α_k\alpha\_1, \ldots, \alpha\_k such that (α_1+12,α_2+12,,α_k+12)\left(\alpha\_1 + \frac{1}{2}, \alpha\_2 + \frac{1}{2}, \ldots, \alpha\_k + \frac{1}{2}\right) is a point in the universe and it does not belong in any of the G_1,,G_nG\_1, \ldots, G\_n. If there are multiple solutions, print the lexicographically smallest one.