#include <bits/stdc++.h>
using namespace std;
const int N = 101010;
const long long inf = 2000000000 * (long long)2000000000;
int i, x[10][3], ans;
int X[N], Y[N], Z[N];
void gao(int x, int y, int z, int id) {
  X[id] = x;
  Y[id] = y;
  Z[id] = z;
}
long long sqr(long long x) { return x * x; }
long long dis(int a, int b) {
  return sqr(X[a] - X[b]) + sqr(Y[a] - Y[b]) + sqr(Z[a] - Z[b]);
}
int check() {
  long long Mi = inf, Dis, Ma = 0;
  int cnt = 0, i, j;
  for (i = 1; i <= 8; i++)
    for (j = i + 1; j <= 8; j++) {
      Dis = dis(i, j);
      if (Dis < Mi)
        Mi = Dis, cnt = 1;
      else if (Dis == Mi)
        cnt++;
      if (Dis > Ma) Ma = Dis;
    }
  if (Mi == 0) return 0;
  if (cnt != 12) return 0;
  if (Ma != 3 * Mi) return 0;
  return 1;
}
void dfs(int id) {
  if (ans) return;
  if (id == 9) {
    if (check()) {
      ans = 1;
      printf("YES\n");
      for (i = 1; i <= 8; i++) printf("%d %d %d\n", X[i], Y[i], Z[i]);
      return;
    }
    return;
  }
  gao(x[id][0], x[id][1], x[id][2], id);
  dfs(id + 1);
  gao(x[id][0], x[id][2], x[id][1], id);
  dfs(id + 1);
  gao(x[id][1], x[id][0], x[id][2], id);
  dfs(id + 1);
  gao(x[id][1], x[id][2], x[id][0], id);
  dfs(id + 1);
  gao(x[id][2], x[id][0], x[id][1], id);
  dfs(id + 1);
  gao(x[id][2], x[id][1], x[id][0], id);
  dfs(id + 1);
}
int main() {
  for (i = 1; i <= 8; i++) cin >> x[i][0] >> x[i][1] >> x[i][2];
  dfs(1);
  if (!ans) printf("NO\n");
}
