#include <bits/stdc++.h>
using namespace std;
long long num[8][3], d[70];
long long dis(int i, int j) {
  return (num[i][0] - num[j][0]) * (num[i][0] - num[j][0]) +
         (num[i][1] - num[j][1]) * (num[i][1] - num[j][1]) +
         (num[i][2] - num[j][2]) * (num[i][2] - num[j][2]);
}
void out() {
  for (int i = 0; i < 8; ++i) {
    printf("%lld", num[i][0]);
    for (int j = 1; j < 3; ++j) printf(" %lld", num[i][j]);
    printf("\n");
  }
}
int vis[8][8];
bool check() {
  int cnt = 0;
  int cnt1 = 0, cnt2 = 0, cnt3 = 0;
  long long L = (1LL) << 60;
  memset(vis, 0, sizeof(vis));
  for (int i = 0; i < 8; ++i)
    for (int j = 0; j < 8; ++j)
      if (i != j && !vis[i][j] && !vis[j][i]) {
        d[cnt++] = dis(i, j);
        vis[i][j] = vis[j][i] = 1;
        if (L > d[cnt - 1]) L = d[cnt - 1];
      }
  if (L == 0) return false;
  for (int i = 0; i < cnt; ++i)
    if (d[i] == L)
      cnt1++;
    else if (d[i] == 2 * L)
      cnt2++;
    else if (d[i] == 3 * L)
      cnt3++;
  if (cnt1 == 12 && cnt2 == 12 && cnt3 == 4) return true;
  return false;
}
bool dfs(int cur) {
  if (cur >= 8) return false;
  sort(num[cur], num[cur] + 3);
  do {
    if (check()) {
      printf("YES\n");
      out();
      return true;
    }
    if (dfs(cur + 1)) return true;
  } while (next_permutation(num[cur], num[cur] + 3));
  return false;
}
int main() {
  for (int i = 0; i < 8; ++i)
    for (int j = 0; j < 3; ++j) scanf("%lld", &num[i][j]);
  if (!dfs(0)) printf("NO\n");
  return 0;
}
