#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;
}
