#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const double eps = 1e-8;
int cas = 1;
long long c[8][3];
long long d[8][8];
inline long long dist(long long a[3], long long b[3]) {
  long long res = 0;
  for (int i = 0; i < 3; i++) res += (a[i] - b[i]) * (a[i] - b[i]);
  return res;
}
long long a;
bool judge() {
  a = 1LL << 60;
  for (int i = 0; i < 8; i++)
    for (int j = i + 1; j < 8; j++) {
      d[i][j] = d[j][i] = dist(c[i], c[j]);
      if (d[i][j] < a) a = d[i][j];
    }
  for (int i = 0; i < 8; i++) {
    int x, y, z;
    x = y = z = 0;
    for (int j = 0; j < 8; j++) {
      if (i == j) continue;
      if (d[i][j] == a)
        x++;
      else if (d[i][j] == 2 * a)
        y++;
      else if (d[i][j] == 3 * a)
        z++;
      else
        return 0;
    }
    if (!(x == 3 && y == 3 && z == 1)) return 0;
  }
  return 1;
}
bool dfs(int cur) {
  if (cur == 8) return judge();
  for (int i = 0; i < 6; i++) {
    if (dfs(cur + 1)) return 1;
    next_permutation(c[cur], c[cur] + 3);
  }
  return 0;
}
void test() {
  for (int i = 0; i < 8; i++)
    for (int j = 0; j < 3; j++) scanf("%I64d", &c[i][j]);
  a = 1LL << 60;
  for (int i = 0; i < 8; i++)
    for (int j = i + 1; j < 8; j++) {
      d[i][j] = d[j][i] = dist(c[i], c[j]);
      if (d[i][j] < a) a = d[i][j];
    }
  cout << judge() << endl;
}
int main() {
  for (int i = 0; i < 8; i++)
    for (int j = 0; j < 3; j++) scanf("%I64d", &c[i][j]);
  if (dfs(0)) {
    puts("YES");
    for (int i = 0; i < 8; i++)
      printf("%I64d %I64d %I64d\n", c[i][0], c[i][1], c[i][2]);
  } else
    puts("NO");
  return 0;
}
