#include <bits/stdc++.h>
using namespace std;
struct Point {
  int x, y, z;
  Point() {}
  Point(int x, int y, int z) : x(x), y(y), z(z) {}
} a[8];
long long d[8];
bool ok;
void dist(long long& d, int x, int y, int z) {
  d = (long long)x * x + (long long)y * y + (long long)z * z;
}
void check() {
  for (int i = (0); i < (8); ++i) {
    for (int j = (0); j < (8); ++j)
      dist(d[j], a[i].x - a[j].x, a[i].y - a[j].y, a[i].z - a[j].z);
    sort(d, d + 8);
    if (!d[1]) return;
    if (d[1] != d[2] || d[1] != d[3]) return;
    if (d[4] != 2 * d[1]) return;
    if (d[4] != d[5] || d[5] != d[6]) return;
    if (d[7] != 3 * d[1]) return;
  }
  ok = 1;
  printf("YES\n");
  for (int i = (0); i < (8); ++i) printf("%d %d %d\n", a[i].x, a[i].y, a[i].z);
}
void dfs(int cur = 0) {
  if (ok) return;
  if (cur == 8) {
    check();
    return;
  }
  int x = a[cur].x, y = a[cur].y, z = a[cur].z;
  a[cur] = Point(x, y, z);
  dfs(cur + 1);
  a[cur] = Point(x, z, y);
  dfs(cur + 1);
  a[cur] = Point(y, x, z);
  dfs(cur + 1);
  a[cur] = Point(y, z, x);
  dfs(cur + 1);
  a[cur] = Point(z, x, y);
  dfs(cur + 1);
  a[cur] = Point(z, y, x);
  dfs(cur + 1);
}
int read() {
  for (int i = (0); i < (8); ++i)
    if (!~scanf("%d%d%d", &a[i].x, &a[i].y, &a[i].z)) return 0;
  return 1;
}
void solve() {
  ok = 0;
  dfs();
  if (!ok) printf("NO\n");
}
int main() {
  while (read()) solve();
  return 0;
}
