#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const double eps = 1e-8;
const int nm = 300005;
int n, k, m, t;
long long res;
int a[10][4];
int b[10][4];
int s1[7] = {0, 1, 1, 2, 2, 3, 3};
int s2[7] = {0, 2, 3, 1, 3, 1, 2};
int s3[7] = {0, 3, 2, 3, 1, 2, 1};
struct Node {
  double gt;
  int sl;
  Node() { ; }
  void clear() {
    gt = -1;
    sl = 0;
  }
};
double _hypot(int x, int y, int z) {
  return sqrt(1. * x * x + 1. * y * y + 1. * z * z);
}
Node u[4];
bool cmp(Node x, Node y) {
  if (x.sl != y.sl) return x.sl < y.sl;
  return x.gt > y.gt;
}
void SS() {
  int i, j;
  double tmp;
  u[1].clear();
  u[2].clear();
  u[3].clear();
  for (i = 1; i <= 7; i++)
    for (j = i + 1; j <= 8; j++) {
      tmp = _hypot(b[i][1] - b[j][1], b[i][2] - b[j][2], b[i][3] - b[j][3]);
      if (u[1].sl == 0) {
        u[1].sl++;
        u[1].gt = tmp;
      } else if (fabs(tmp - u[1].gt) < eps)
        u[1].sl++;
      else if (u[2].sl == 0) {
        u[2].sl++;
        u[2].gt = tmp;
      } else if (fabs(tmp - u[2].gt) < eps)
        u[2].sl++;
      else if (u[3].sl == 0) {
        u[3].sl++;
        u[3].gt = tmp;
      } else if (fabs(u[3].gt - tmp) < eps)
        u[3].sl++;
      else
        return;
    }
  sort(u + 1, u + 4, cmp);
  if (u[1].sl == 4 && u[2].sl == 12 && u[3].sl == 12 &&
      fabs(u[1].gt * sqrt(2) - u[2].gt * sqrt(3)) < eps &&
      fabs(u[1].gt - u[3].gt * sqrt(3)) < eps) {
    cout << "YES\n";
    for (i = 1; i <= 8; i++) printf("%d %d %d\n", b[i][1], b[i][2], b[i][3]);
    exit(0);
  }
}
void Try(int vt, int type) {
  int i;
  b[vt][1] = a[vt][s1[type]];
  b[vt][2] = a[vt][s2[type]];
  b[vt][3] = a[vt][s3[type]];
  if (vt == 8) {
    SS();
    return;
  }
  for (i = 1; i <= 6; i++) Try(vt + 1, i);
}
int main() {
  int i, j, x, y, z, w;
  for (i = 1; i <= 8; i++)
    for (j = 1; j <= 3; j++) scanf("%d", &a[i][j]);
  b[1][1] = a[1][1];
  b[1][2] = a[1][2];
  b[1][3] = a[1][3];
  for (i = 1; i <= 6; i++) Try(2, i);
  cout << "NO";
  return 0;
}
