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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const long maxn = 20;
struct node {
  long x, y, z;
} c[maxn];
long i, j, k, l;
long a[maxn][5], b[maxn][5];
long he[maxn][5] = {{0, 1, 2}, {0, 2, 1}, {1, 0, 2},
                    {1, 2, 0}, {2, 0, 1}, {2, 1, 0}};
long cmp(node a, node b) {
  if (a.x > b.x) return 1;
  if (b.x > a.x) return 0;
  if (a.y > b.y) return 1;
  if (b.y > a.y) return 0;
  if (a.z > b.z) return 1;
  return 0;
}
long long pf(long long x) {
  x *= x;
  return x;
}
long long jl(node a, node b) {
  return pf(a.x - b.x) + pf(a.y - b.y) + pf(a.z - b.z);
}
node mid(node a, node b) {
  node tmp;
  tmp.x = (a.x + b.x);
  tmp.y = (a.y + b.y);
  tmp.z = (a.z + b.z);
  return tmp;
}
long pd2() {
  long long la1, la2, lb1, lb2, tmp;
  long i, j, k, l;
  for (i = 2; i <= 4; ++i) {
    for (j = 2; j <= 4; ++j)
      if (j != i) break;
    for (k = 2; k <= 4; ++k)
      if (k != i && k != j) break;
    la1 = jl(c[1], c[i]);
    la2 = jl(c[1], c[9 - i]);
    if (la1 > la2) {
      tmp = la1;
      la1 = la2;
      la2 = tmp;
    }
    lb1 = jl(c[j], c[k]);
    lb2 = jl(c[j], c[9 - k]);
    if (lb1 > lb2) {
      tmp = lb1;
      lb1 = lb2;
      lb2 = tmp;
    }
    if (la1 != lb1 || la2 != lb2) return 0;
  }
  return 1;
}
long pd() {
  node tmp2, tmp3;
  long long tmp;
  long i, j, k, l;
  for (i = 1; i <= 8; ++i) {
    c[i].x = b[i][0];
    c[i].y = b[i][1];
    c[i].z = b[i][2];
    if (i > 1 && jl(c[i], c[1]) == 0) return 0;
  }
  sort(c + 1, c + 9, cmp);
  tmp = jl(c[1], c[8]);
  tmp2 = mid(c[1], c[8]);
  for (i = 1; i <= 3; ++i) {
    if (jl(c[i + 1], c[8 - i]) != tmp) return 0;
    tmp3 = mid(c[i + 1], c[8 - i]);
    if (tmp2.x != tmp3.x || tmp2.y != tmp3.y || tmp2.z != tmp3.z) return 0;
  }
  return pd2();
}
void work(long deep) {
  long i, j;
  if (deep > 8) {
    if (pd()) {
      puts("YES");
      for (i = 1; i <= 8; ++i) {
        for (j = 0; j < 3; ++j) printf("%ld ", b[i][j]);
        puts("");
        ;
      }
      exit(0);
    }
    return;
  }
  for (i = 0; i < 6; ++i) {
    for (j = 0; j < 3; ++j) {
      b[deep][j] = a[deep][he[i][j]];
    }
    work(deep + 1);
  }
  return;
}
int main() {
  for (i = 1; i <= 8; ++i) scanf("%ld%ld%ld", &a[i][0], &a[i][1], &a[i][2]);
  for (i = 0; i < 3; ++i) b[1][i] = a[1][i];
  work(2);
  puts("NO");
  return 0;
}