#include <bits/stdc++.h>
using namespace std;
long long sqr(const int a) { return 1ll * a * a; }
int x[8][3];
bool solve(const int d) {
  if (d < 8) {
    sort(x[d], x[d] + 3);
    do {
      if (solve(d + 1)) {
        return true;
      }
    } while (next_permutation(x[d], x[d] + 3));
  } else {
    map<long long, int> dc;
    for (int i = 0; i < 8; i++) {
      for (int j = i + 1; j < 8; j++) {
        const long long t = sqr(x[i][0] - x[j][0]) + sqr(x[i][1] - x[j][1]) +
                            sqr(x[i][2] - x[j][2]);
        dc[t]++;
      }
    }
    const long long a = dc.begin()->first;
    if (dc.size() == 3 && dc.begin()->second == 12 &&
        (++dc.begin())->first == 2ll * a && (++dc.begin())->second == 12 &&
        (++(++dc.begin()))->first == 3ll * a &&
        (++(++dc.begin()))->second == 4) {
      puts("YES");
      for (int i = 0; i < 8; i++) {
        printf("%d %d %d\n", x[i][0], x[i][1], x[i][2]);
      }
      return true;
    }
  }
  return false;
}
int main() {
  for (int i = 0; i < 8; i++) {
    for (int j = 0; j < 3; j++) {
      scanf("%d", &x[i][j]);
    }
  }
  if (!solve(1)) {
    puts("NO");
  }
  return 0;
}
