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;
int GCD(int a, int b) {
  if (!a) return b;
  return GCD(b % a, a);
}
vector<vector<int>> points(8, vector<int>(3));
vector<vector<int>> ans;
long long dist(int p1, int &p2) {
  int x1 = points[p1][0], y1 = points[p1][1], z1 = points[p1][2];
  int x2 = points[p2][0], y2 = points[p2][1], z2 = points[p2][2];
  long long ret = 0;
  ret += (x1 - x2) * (long long)(x1 - x2);
  ret += (y1 - y2) * (long long)(y1 - y2);
  ret += (z1 - z2) * (long long)(z1 - z2);
  return ret;
}
bool trt = false;
vector<long long> D(64);
bool ok() {
  D.clear();
  long long d1 = 0, d2 = 0;
  for (int i = (0); i < (int)(8); i++) {
    for (int j = (i + 1); j < (int)(8); j++) {
      long long d = dist(i, j);
      D.push_back(d);
      if (d >= d1) {
        d1 = d;
      } else if (d >= d2) {
        d2 = d;
      }
    }
  }
  if (!d1 || !d2) return false;
  int cd1, cd2, cd3;
  cd1 = cd2 = cd3 = 0;
  for (int i = (0); i < (int)(D.size()); i++) {
    if (D[i] == d1)
      cd1++;
    else if (D[i] == d2)
      cd2++;
  }
  if (cd2 != 12) return false;
  if (cd1 != 4) return false;
  return true;
}
int go(int at) {
  if (trt) return 0;
  if (at == 8) {
    if (ok()) {
      ans = points;
      trt = true;
    }
    return 0;
  }
  do {
    go(at + 1);
  } while (next_permutation(points[at].begin(), points[at].end()));
  return 0;
}
int main() {
  clock_t startTime = clock();
  ios_base::sync_with_stdio(true);
  for (int i = (0); i < (int)(8); i++) {
    for (int j = (0); j < (int)(3); j++) cin >> points[i][j];
    sort(points[i].begin(), points[i].end());
  }
  go(0);
  if (trt) {
    cout << "YES\n";
    for (int i = (0); i < (int)(8); i++) {
      for (int j = (0); j < (int)(3); j++) cout << ans[i][j] << " ";
      cout << "\n";
    }
  } else
    cout << "NO\n";
  clock_t endTime = clock();
  cerr << "\nTime:" << double(endTime - startTime) / CLOCKS_PER_SEC
       << " seconds\n";
  return 0;
}