Problem: Peter had a cube with non-zero length of a side. He put the cube into three-dimensional space in such a way that its vertices lay at integer points (it is possible that the cube's sides are not parallel to the coordinate axes). Then he took a piece of paper and wrote down eight lines, each containing three integers — coordinates of cube's vertex (a single line contains coordinates of a single vertex, each vertex is written exactly once), put the paper on the table and left. While Peter was away, his little brother Nick decided to play with the numbers on the paper. In one operation Nick could swap some numbers inside a single line (Nick didn't swap numbers from distinct lines). Nick could have performed any number of such operations.

When Peter returned and found out about Nick's mischief, he started recollecting the original coordinates. Help Peter restore the original position of the points or else state that this is impossible and the numbers were initially recorded incorrectly.

Input

Each of the eight lines contains three space-separated integers — the numbers written on the piece of paper after Nick's mischief. All numbers do not exceed 106 in their absolute value.

Output

If there is a way to restore the cube, then print in the first line "YES". In each of the next eight lines print three integers — the restored coordinates of the points. The numbers in the i-th output line must be a permutation of the numbers in i-th input line. The numbers should represent the vertices of a cube with non-zero length of a side. If there are multiple possible ways, print any of them.

If there is no valid way, print "NO" (without the quotes) in the first line. Do not print anything else.

Examples

Input

0 0 0
0 0 1
0 0 1
0 0 1
0 1 1
0 1 1
0 1 1
1 1 1


Output

YES
0 0 0
0 0 1
0 1 0
1 0 0
0 1 1
1 0 1
1 1 0
1 1 1


Input

0 0 0
0 0 0
0 0 0
0 0 0
1 1 1
1 1 1
1 1 1
1 1 1


Output

NO

Solution (in PYTHON3):

Solution:
import itertools
from itertools import permutations as perm

l = [[int(x) for x in input().split()] for i in range(8)]

def dist2(p0,p1):
    return sum([(p0[i]-p1[i])**2 for i in range(3)])

def sub(p0,p1):
    return [p0[i]-p1[i] for i in range(3)]

def add(p0,p1):
    return [p0[i]+p1[i] for i in range(3)]

def div(p0,x):
    return [p0[i]//x for i in range(3)]

def cross(p0,p1):
    return [p0[(i+1)%3]*p1[(i+2)%3]-p0[(i+2)%3]*p1[(i+1)%3] for i in range(3)]

def match(p0,p1):
    return sorted(p0) == sorted(p1)

solved = False
for l2 in perm(l,3):
    p0 = l2[0]
    for p1 in perm(l2[1]):
        s2 = dist2(p0,p1)
        if s2 == 0: continue
        s = round(s2**.5)
        if s**2 != s2: continue
        for p2 in perm(l2[2]):
            if dist2(p0,p2) != s2 or dist2(p1,p2) != 2*s2: continue
            p3 = sub(add(p1,p2),p0)
            x = div(cross(sub(p1,p0),sub(p2,p0)),s)
            p4,p5,p6,p7 = add(p0,x),add(p1,x),add(p2,x),add(p3,x)
            l3 = [p0,p1,p2,p3,p4,p5,p6,p7]
            if sorted([sorted(p) for p in l]) == sorted([sorted(p) for p in l3]):
                print("YES")
                used = [False for i in range(8)]
                for p in l:
                    for i in range(8):
                        if used[i]: continue
                        if match(p,l3[i]):
                            print(l3[i][0],l3[i][1],l3[i][2])
                            used[i] = True
                            break
                solved = True
                break
        if solved: break
    if solved: break

if not solved: print("NO")
#if not poss(1,[l[0]]): print("NO")