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;
long long x[9], y[9], z[9];
bool pos = false;
void myFn(long long i_1, long long i_2, long long i_3, long long i_4,
          long long i_5, long long i_6, long long i_7) {
  vector<long long> st(7);
  st[0] = i_1;
  st[1] = i_2;
  st[2] = i_3;
  st[3] = i_4;
  st[4] = i_5;
  st[5] = i_6;
  st[6] = i_7;
  vector<vector<long long> > ret(8, vector<long long>(3));
  for (long long i = 1; i <= 7; i++) {
    if (st[i - 1] == 1) {
      ret[i - 1][0] = x[i];
      ret[i - 1][1] = y[i];
      ret[i - 1][2] = z[i];
    } else if (st[i - 1] == 2) {
      ret[i - 1][0] = x[i];
      ret[i - 1][1] = z[i];
      ret[i - 1][2] = y[i];
    } else if (st[i - 1] == 3) {
      ret[i - 1][0] = y[i];
      ret[i - 1][1] = x[i];
      ret[i - 1][2] = z[i];
    } else if (st[i - 1] == 4) {
      ret[i - 1][0] = y[i];
      ret[i - 1][1] = z[i];
      ret[i - 1][2] = x[i];
    } else if (st[i - 1] == 5) {
      ret[i - 1][0] = z[i];
      ret[i - 1][1] = y[i];
      ret[i - 1][2] = x[i];
    } else if (st[i - 1] == 6) {
      ret[i - 1][0] = z[i];
      ret[i - 1][1] = x[i];
      ret[i - 1][2] = y[i];
    }
  }
  ret[7][0] = x[8];
  ret[7][1] = y[8];
  ret[7][2] = z[8];
  long long MIN = LLONG_MAX;
  vector<long long> arb(28);
  long long cnt = 0;
  for (long long i = 0; i <= ret.size() - 2; i++) {
    for (long long j = i + 1; j <= ret.size() - 1; j++) {
      long long val = 0;
      for (long long k = 0; k < 3; k++) {
        val += (ret[i][k] - ret[j][k]) * (ret[i][k] - ret[j][k]);
      }
      MIN = min(MIN, val);
      arb[cnt] = val;
      cnt += 1;
    }
  }
  long long a = 0, b = 0, c = 0;
  for (long long q = 0; q < arb.size(); q++) {
    if (arb[q] == MIN)
      a += 1;
    else if (arb[q] == 2 * MIN)
      b += 1;
    else if (arb[q] == 3 * MIN)
      c += 1;
  }
  if (a == 12 and b == 12 and c == 4) {
    cout << "YES" << endl;
    for (long long i = 0; i < ret.size(); i++) {
      for (long long j = 0; j < ret[i].size(); j++) cout << ret[i][j] << " ";
      cout << endl;
    }
    pos = true;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  for (long long i = 1; i <= 8; i++) cin >> x[i] >> y[i] >> z[i];
  for (long long i_1 = 1; i_1 <= 6; i_1++) {
    for (long long i_2 = 1; i_2 <= 6; i_2++) {
      for (long long i_3 = 1; i_3 <= 6; i_3++) {
        for (long long i_4 = 1; i_4 <= 6; i_4++) {
          for (long long i_5 = 1; i_5 <= 6; i_5++) {
            for (long long i_6 = 1; i_6 <= 6; i_6++) {
              for (long long i_7 = 1; i_7 <= 6; i_7++) {
                myFn(i_1, i_2, i_3, i_4, i_5, i_6, i_7);
                if (pos) return 0;
              }
            }
          }
        }
      }
    }
  }
  cout << "NO" << endl;
}