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 N = 11;
int vi(0), o[N], ob[N];
double v[N][N], dis[N];
bool cmp(int ca, int cb) {
  return (dis[ca] > dis[cb]) || (dis[ca] == dis[cb] && ca < cb);
}
double Dis(int da, int db) {
  return sqrt((v[da][1] - v[db][1]) * (v[da][1] - v[db][1]) +
              (v[da][2] - v[db][2]) * (v[da][2] - v[db][2]) +
              (v[da][3] - v[db][3]) * (v[da][3] - v[db][3]));
}
inline void COME() {
  register int i, j;
  ;
  for (i = 1; i <= 8; ++i) o[i] = i;
  for (i = 1; i <= 8; ++i) dis[i] = Dis(1, i);
  sort(o + 1, o + 9, cmp);
  for (i = 1; i <= 8; ++i)
    for (j = 1; j <= 8; ++j)
      if (i != j)
        if (v[i][1] == v[j][1] && v[i][2] == v[j][2] && v[i][3] == v[j][3])
          return;
  if (dis[o[1]] != dis[o[2]] && dis[o[2]] == dis[o[3]] &&
      dis[o[3]] == dis[o[4]])
    if (dis[o[4]] != dis[o[5]] && dis[o[5]] == dis[o[6]] &&
        dis[o[6]] == dis[o[7]]) {
      for (i = 1; i <= 8; ++i) ob[i] = i;
      for (i = 1; i <= 8; ++i) dis[i] = Dis(o[1], i);
      sort(ob + 1, ob + 9, cmp);
      if (ob[1] == o[8] && o[2] == ob[5] && o[3] == ob[6] && o[4] == ob[7])
        if (o[1] == ob[8] && ob[2] == o[5] && ob[3] == o[6] && ob[4] == o[7]) {
          vi = 1;
          printf("YES\n");
          for (i = 1; i <= 8; ++i) {
            for (j = 1; j <= 3; ++j) printf("%.0lf ", v[i][j]);
            printf("\n");
          }
        }
    }
}
inline void DFS(int o) {
  register int i, j;
  ;
  if (o == 9 && !vi) {
    COME();
    return;
  }
  for (i = 1; i <= 2; ++i)
    for (j = i + 1; j <= 3; ++j)
      if (!vi) {
        swap(v[o][i], v[o][j]), DFS(o + 1);
        swap(v[o][2], v[o][3]), DFS(o + 1);
        swap(v[o][2], v[o][3]), swap(v[o][i], v[o][j]);
      }
}
int main() {
  register int i, j;
  ;
  for (i = 1; i <= 8; ++i)
    for (j = 1; j <= 3; ++j) scanf("%lf", &v[i][j]);
  DFS(1);
  if (!vi) printf("NO\n");
  return 0;
}