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 maxN = 1010;
const int modu = (1e8) + 7;
const int inf = 1e9;
int a[10][10], cs[10];
struct td {
  long long x, y, z;
} b[10];
bool fr[16];
void init() {}
td gan(int k, int x, int y, int z) {
  td tam;
  tam.x = a[k][x];
  tam.y = a[k][y];
  tam.z = a[k][z];
  return tam;
}
bool kc(td a, td b) {
  return (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y) +
         (a.z - b.z) * (a.z - b.z);
}
bool vuong(td a, td b, td c) {
  return ((a.x - b.x) * (a.x - c.x) + (a.y - b.y) * (a.y - c.y) +
          (a.z - b.z) * (a.z - c.z)) == 0;
}
bool operator==(td x, td y) {
  if (x.x != y.x) return false;
  if (x.y != y.y) return false;
  if (x.z != y.z) return false;
  return true;
}
bool kt(int k) {
  for (int i = 1; i < k; i++)
    for (int j = i + 1; j < k + 1; j++)
      if (b[i] == b[j]) return false;
  if (k <= 2) return true;
  if (k == 3) {
    if (!vuong(b[2], b[1], b[3])) return false;
    return kc(b[1], b[2]) == kc(b[2], b[3]);
  }
  if (k == 4) {
    if (!vuong(b[4], b[1], b[3])) return false;
    if (!vuong(b[1], b[2], b[4])) return false;
    if (!vuong(b[3], b[4], b[2])) return false;
    return (kc(b[1], b[4]) == kc(b[1], b[2])) &&
           (kc(b[3], b[4]) == kc(b[1], b[2]));
  }
  if (k == 5) {
    if (!vuong(b[1], b[2], b[5])) return false;
    if (!vuong(b[1], b[4], b[5])) return false;
    return kc(b[1], b[2]) == kc(b[1], b[5]);
  }
  if (k == 6) {
    if (!vuong(b[6], b[5], b[2])) return false;
    if (!vuong(b[5], b[1], b[6])) return false;
    return (kc(b[5], b[6]) == kc(b[2], b[6])) &&
           (kc(b[2], b[6]) == kc(b[1], b[2]));
  }
  if (k == 7) {
    if (!vuong(b[7], b[3], b[6])) return false;
    if (!vuong(b[6], b[7], b[2])) return false;
    if (!vuong(b[6], b[5], b[7])) return false;
    return (kc(b[7], b[6]) == kc(b[7], b[3])) &&
           (kc(b[7], b[6]) == kc(b[1], b[2]));
  }
  if (k == 8) {
    if (!vuong(b[8], b[7], b[5])) return false;
    if (!vuong(b[5], b[8], b[6])) return false;
    if (!vuong(b[7], b[8], b[6])) return false;
    if (!vuong(b[8], b[4], b[7])) return false;
    if (!vuong(b[4], b[8], b[3])) return false;
    return (kc(b[8], b[4]) == kc(b[8], b[5])) &&
           (kc(b[8], b[4]) == kc(b[8], b[7])) &&
           (kc(b[8], b[4]) == kc(b[1], b[2]));
  }
  return false;
}
bool dq1(int k) {
  if (k > 8) {
    if (kt(8)) {
      cout << "YES"
           << "\n";
      for (int i = 0; i < 8; i++)
        printf("%I64d %I64d %I64d\n", b[cs[i]].x, b[cs[i]].y, b[cs[i]].z);
      return true;
    }
    return false;
  }
  if (!kt(k - 1)) return false;
  for (int i = 0; i < 8; i++)
    if (fr[i]) {
      fr[i] = false;
      cs[i] = k;
      b[k] = gan(i, 1, 2, 3);
      if (dq1(k + 1)) return true;
      b[k] = gan(i, 1, 3, 2);
      if (dq1(k + 1)) return true;
      b[k] = gan(i, 2, 1, 3);
      if (dq1(k + 1)) return true;
      b[k] = gan(i, 2, 3, 1);
      if (dq1(k + 1)) return true;
      b[k] = gan(i, 3, 1, 2);
      if (dq1(k + 1)) return true;
      b[k] = gan(i, 3, 2, 1);
      if (dq1(k + 1)) return true;
      fr[i] = true;
      if (k == 1) return false;
    }
}
void xuly() {
  for (int i = 0; i < 8; i++)
    for (int j = 0; j < 3; j++) cin >> a[i][1 + j];
  memset(fr, true, sizeof(fr));
  if (!dq1(1)) cout << "NO";
}
int main() {
  init();
  xuly();
  fclose(stdin);
  fclose(stdout);
  return 0;
}