Octasection
题号:NC214894
时间限制:C/C++/Rust/Pascal 3秒,其他语言6秒
空间限制:C/C++/Rust/Pascal 1024 M,其他语言2048 M
Special Judge, 64bit IO Format: %lld

题目描述

At the Namomo Camp, a cute volunteer celebrates her birthday. Wowo buys her a huge cake. (The cake is so big that it has a 3D coordinate system inside.) There are cuboid shaped pieces of chocolates in the cake. The -th () chocolate consists of all points such that . are arrays of integers. Chocolates may overlap or touch each other.

The volunteer wants to distribute the cake to the campers of the Namomo Camp. To show off his knife skill, Wowo decides to cut the cake into pieces by exactly cuts such that:

1. The first cut is a plane whose equation is for some integer decided by Wowo.
2. The second cut is a plane whose equation is for some integer decided by Wowo.
3. The third cut is a plane whose equation is for some integer decided by Wowo.
4. Each chocolate is touched by at least one cut (i.e. each cuboid has a nonempty intersection with at least one plane).

Decide whether Wowo can cut the cake under the rules. If the answer is yes, output any possible solution.

输入描述:

The first line contains a single integer  ().

The -th line of the next lines contains integers (, , , ).

输出描述:

If Wowo can cut the cake under the rules, the first line of the output should contain "YES" and the second line should contain  integers ,  and  (). If Wowo cannot cut the cake under the rules, output only one line containing "NO".
示例1

输入

复制
3
0 1 0 1 0 1
10 11 10 11 10 11
999999999 1000000000 999999999 1000000000 999999999 1000000000

输出

复制
YES
0 10 999999999
示例2

输入

复制
4
0 1 0 1 0 1
999999999 1000000000 0 1 0 1
0 1 999999999 1000000000 0 1
0 1 0 1 999999999 1000000000

输出

复制
YES
0 0 0