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;
struct node {
  long long x, y, z;
  node() {}
  node(long long _x, long long _y, long long _z) { x = _x, y = _y, z = _z; }
  bool operator==(node &B) const { return x == B.x && y == B.y && z == B.z; }
} a[8], arr[8][6];
long long x[30], out = 0;
long long check() {
  sort(x, x + 28);
  for (long long i = 0; i < 28; i++)
    if (!x[i]) return 0;
  for (long long i = 1; i < 12; i++)
    if (x[i] != x[i - 1]) return 0;
  for (long long i = 13; i < 24; i++)
    if (x[i] != x[i - 1]) return 0;
  for (long long i = 25; i < 28; i++)
    if (x[i] != x[i - 1]) return 0;
  long long xx = x[0], yy = x[12], zz = x[24];
  if (2 * xx == yy && 3 * yy == 2 * zz && zz == xx * 3) return 1;
  return 0;
}
void init() {
  for (long long i = 0; i < 8; i++) {
    long long t[8][3], l[3] = {0, 1, 2}, k = 0;
    for (long long i = 0; i < 8; i++) {
      t[i][0] = a[i].x;
      t[i][1] = a[i].y;
      t[i][2] = a[i].z;
    }
    do {
      arr[i][k++] = node(t[i][l[0]], t[i][l[1]], t[i][l[2]]);
    } while (next_permutation(l, l + 3));
  }
}
void get_x() {
  long long k = 0;
  for (long long i = 0; i < 8; i++) {
    for (long long j = i + 1; j < 8; j++) {
      long long aa = a[i].x - a[j].x;
      long long bb = a[i].y - a[j].y;
      long long cc = a[i].z - a[j].z;
      x[k++] = aa * aa + bb * bb + cc * cc;
    }
  }
}
void DFS(long long now) {
  if (out) return;
  if (now == 8) {
    get_x();
    if (check()) {
      out = 1;
      printf("YES\n");
      for (long long i = 0; i < 8; i++) {
        printf("%lld %lld %lld\n", a[i].x, a[i].y, a[i].z);
      }
    }
    return;
  }
  for (long long i = 0; i < 6; i++) {
    if (i != 0 && arr[now][i] == arr[now][i - 1]) continue;
    bool flag = false;
    for (long long j = 0; j < now; j++) {
      if (a[i] == a[now]) {
        flag = true;
        break;
      }
    }
    if (flag) continue;
    a[now] = arr[now][i];
    DFS(now + 1);
  }
}
signed main() {
  for (long long i = 0; i < 8; i++) cin >> a[i].x >> a[i].y >> a[i].z;
  init();
  DFS(0);
  if (out == 0) printf("NO\n");
  return 0;
}