#include <bits/stdc++.h>
using namespace std;
struct coord {
  long long x, y, z;
  bool operator<(coord a) const {
    if (x != a.x)
      return x < a.x;
    else if (y != a.y)
      return y < a.y;
    else
      return z < a.z;
  }
} aux[8];
int v[8][3], ans = 0;
long long dist(int i, int j) {
  long long x = (long long)abs(aux[i].x - aux[j].x);
  long long y = (long long)abs(aux[i].y - aux[j].y);
  long long z = (long long)abs(aux[i].z - aux[j].z);
  return (long long)(x * x + y * y + z * z);
}
void ok() {
  for (int i = 0; i < 8; ++i) {
    aux[i].x = v[i][0];
    aux[i].y = v[i][1];
    aux[i].z = v[i][2];
  }
  long long l = 0x3F3F3F3F3F3F3F3FLL;
  for (int i = 0; i < 7; ++i) {
    for (int j = i + 1; j < 8; ++j) {
      l = min(l, dist(i, j));
    }
  }
  if (l == 0LL) return;
  int cont[3];
  for (int i = 0; i < 8; ++i) {
    memset(cont, 0, sizeof cont);
    for (int j = 0; j < 8; ++j) {
      if (i == j) continue;
      long long d = dist(i, j);
      if (d == l)
        cont[0]++;
      else if (d == l * 2LL)
        cont[1]++;
      else if (d == l * 3LL)
        cont[2]++;
    }
    if (cont[0] != 3 || cont[1] != 3 || cont[2] != 1) return;
  }
  ans = 1;
}
void f(int nivel) {
  if (nivel == 8) {
    ok();
    return;
  }
  sort(v[nivel], v[nivel] + 3);
  do {
    f(nivel + 1);
    if (ans) return;
  } while (next_permutation(v[nivel], v[nivel] + 3));
}
int main() {
  for (int i = 0; i < 8; ++i) {
    for (int j = 0; j < 3; ++j) scanf("%d", &v[i][j]);
  }
  f(1);
  if (ans) {
    printf("YES\n");
    for (int i = 0; i < 8; ++i) {
      printf("%d %d %d\n", v[i][0], v[i][1], v[i][2]);
    }
  } else
    printf("NO\n");
  return 0;
}
