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 double SQRT_2 = 1.41421356237;
const double SQRT_3 = 1.73205080757;
int coords[24];
double dist(int die1, int die2) {
  double x1 = coords[die1 * 3];
  double x2 = coords[die2 * 3];
  double y1 = coords[die1 * 3 + 1];
  double y2 = coords[die2 * 3 + 1];
  double z1 = coords[die1 * 3 + 2];
  double z2 = coords[die2 * 3 + 2];
  return sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1) +
              (z2 - z1) * (z2 - z1));
}
bool is_cube(int up_to_die) {
  double length = numeric_limits<double>().max();
  for (int i = 0; i <= 4 && i <= up_to_die; ++i) {
    for (int j = i + 1; j <= 4 && j <= up_to_die; ++j) {
      double d = dist(i, j);
      if (d < length) length = d;
    }
  }
  double l2 = length * SQRT_2;
  double l3 = length * SQRT_3;
  for (int i = 0; i <= up_to_die; ++i) {
    int l_count = 0;
    int l2_count = 0;
    int l3_count = 0;
    for (int j = 0; j <= up_to_die; ++j) {
      if (i == j) continue;
      double d = dist(i, j);
      if (abs(d - length) < .25) {
        if (++l_count > 3) return false;
      } else if (abs(d - l2) < .25) {
        if (++l2_count > 3) return false;
      } else if (abs(d - l3) < .25) {
        if (++l3_count > 1) return false;
      } else {
        return false;
      }
    }
  }
  return true;
}
bool make_dice(int i) {
  if (is_cube(i) && (i == 7 || make_dice(i + 1))) return true;
  int temp = coords[3 * i + 1];
  coords[3 * i + 1] = coords[3 * i + 2];
  coords[3 * i + 2] = temp;
  if (is_cube(i) && (i == 7 || make_dice(i + 1))) return true;
  temp = coords[3 * i];
  coords[3 * i] = coords[3 * i + 1];
  coords[3 * i + 1] = temp;
  if (is_cube(i) && (i == 7 || make_dice(i + 1))) return true;
  temp = coords[3 * i + 1];
  coords[3 * i + 1] = coords[3 * i + 2];
  coords[3 * i + 2] = temp;
  if (is_cube(i) && (i == 7 || make_dice(i + 1))) return true;
  temp = coords[3 * i];
  coords[3 * i] = coords[3 * i + 1];
  coords[3 * i + 1] = temp;
  if (is_cube(i) && (i == 7 || make_dice(i + 1))) return true;
  temp = coords[3 * i + 1];
  coords[3 * i + 1] = coords[3 * i + 2];
  coords[3 * i + 2] = temp;
  if (is_cube(i) && (i == 7 || make_dice(i + 1))) return true;
  return false;
}
int main() {
  for (int i = 0; i < 24; ++i) cin >> coords[i];
  bool res = make_dice(1);
  if (!res) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
    for (int i = 0; i < 8; ++i)
      cout << coords[3 * i] << ' ' << coords[3 * i + 1] << ' '
           << coords[3 * i + 2] << endl;
  }
  return 0;
}