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 int MOD = 1000000007;
const double eps = 1e-8;
const int nm = 300005;
int n, k, m, t;
long long res;
int a[10][4];
int b[10][4];
int s1[7] = {0, 1, 1, 2, 2, 3, 3};
int s2[7] = {0, 2, 3, 1, 3, 1, 2};
int s3[7] = {0, 3, 2, 3, 1, 2, 1};
struct Node {
  double gt;
  int sl;
  Node() { ; }
  void clear() {
    gt = -1;
    sl = 0;
  }
};
double _hypot(int x, int y, int z) {
  return sqrt(1. * x * x + 1. * y * y + 1. * z * z);
}
Node u[4];
bool cmp(Node x, Node y) {
  if (x.sl != y.sl) return x.sl < y.sl;
  return x.gt > y.gt;
}
void SS() {
  int i, j;
  double tmp;
  u[1].clear();
  u[2].clear();
  u[3].clear();
  for (i = 1; i <= 7; i++)
    for (j = i + 1; j <= 8; j++) {
      tmp = _hypot(b[i][1] - b[j][1], b[i][2] - b[j][2], b[i][3] - b[j][3]);
      if (u[1].sl == 0) {
        u[1].sl++;
        u[1].gt = tmp;
      } else if (fabs(tmp - u[1].gt) < eps)
        u[1].sl++;
      else if (u[2].sl == 0) {
        u[2].sl++;
        u[2].gt = tmp;
      } else if (fabs(tmp - u[2].gt) < eps)
        u[2].sl++;
      else if (u[3].sl == 0) {
        u[3].sl++;
        u[3].gt = tmp;
      } else if (fabs(u[3].gt - tmp) < eps)
        u[3].sl++;
      else
        return;
    }
  sort(u + 1, u + 4, cmp);
  if (u[1].sl == 4 && u[2].sl == 12 && u[3].sl == 12 &&
      fabs(u[1].gt * sqrt(2) - u[2].gt * sqrt(3)) < eps &&
      fabs(u[1].gt - u[3].gt * sqrt(3)) < eps) {
    cout << "YES\n";
    for (i = 1; i <= 8; i++) printf("%d %d %d\n", b[i][1], b[i][2], b[i][3]);
    exit(0);
  }
}
void Try(int vt, int type) {
  int i;
  b[vt][1] = a[vt][s1[type]];
  b[vt][2] = a[vt][s2[type]];
  b[vt][3] = a[vt][s3[type]];
  if (vt == 8) {
    SS();
    return;
  }
  for (i = 1; i <= 6; i++) Try(vt + 1, i);
}
int main() {
  int i, j, x, y, z, w;
  for (i = 1; i <= 8; i++)
    for (j = 1; j <= 3; j++) scanf("%d", &a[i][j]);
  b[1][1] = a[1][1];
  b[1][2] = a[1][2];
  b[1][3] = a[1][3];
  for (i = 1; i <= 6; i++) Try(2, i);
  cout << "NO";
  return 0;
}