#include <bits/stdc++.h>
using namespace std;
struct node {
  long long x, y, z;
  node() {}
  node(long long _x, long long _y, long long _z) { x = _x, y = _y, z = _z; }
  bool operator==(node &B) const { return x == B.x && y == B.y && z == B.z; }
} a[8], arr[8][6];
long long x[30], out = 0;
long long check() {
  sort(x, x + 28);
  for (long long i = 0; i < 28; i++)
    if (!x[i]) return 0;
  for (long long i = 1; i < 12; i++)
    if (x[i] != x[i - 1]) return 0;
  for (long long i = 13; i < 24; i++)
    if (x[i] != x[i - 1]) return 0;
  for (long long i = 25; i < 28; i++)
    if (x[i] != x[i - 1]) return 0;
  long long xx = x[0], yy = x[12], zz = x[24];
  if (2 * xx == yy && 3 * yy == 2 * zz && zz == xx * 3) return 1;
  return 0;
}
void init() {
  for (long long i = 0; i < 8; i++) {
    long long t[8][3], l[3] = {0, 1, 2}, k = 0;
    for (long long i = 0; i < 8; i++) {
      t[i][0] = a[i].x;
      t[i][1] = a[i].y;
      t[i][2] = a[i].z;
    }
    do {
      arr[i][k++] = node(t[i][l[0]], t[i][l[1]], t[i][l[2]]);
    } while (next_permutation(l, l + 3));
  }
}
void get_x() {
  long long k = 0;
  for (long long i = 0; i < 8; i++) {
    for (long long j = i + 1; j < 8; j++) {
      long long aa = a[i].x - a[j].x;
      long long bb = a[i].y - a[j].y;
      long long cc = a[i].z - a[j].z;
      x[k++] = aa * aa + bb * bb + cc * cc;
    }
  }
}
void DFS(long long now) {
  if (out) return;
  if (now == 8) {
    get_x();
    if (check()) {
      out = 1;
      printf("YES\n");
      for (long long i = 0; i < 8; i++) {
        printf("%lld %lld %lld\n", a[i].x, a[i].y, a[i].z);
      }
    }
    return;
  }
  for (long long i = 0; i < 6; i++) {
    if (i != 0 && arr[now][i] == arr[now][i - 1]) continue;
    bool flag = false;
    for (long long j = 0; j < now; j++) {
      if (a[i] == a[now]) {
        flag = true;
        break;
      }
    }
    if (flag) continue;
    a[now] = arr[now][i];
    DFS(now + 1);
  }
}
signed main() {
  for (long long i = 0; i < 8; i++) cin >> a[i].x >> a[i].y >> a[i].z;
  init();
  DFS(0);
  if (out == 0) printf("NO\n");
  return 0;
}
