#include <bits/stdc++.h>
using namespace std;
long long point[10][3], point2[10][3];
int perm[6][3] = {{0, 1, 2}, {0, 2, 1}, {1, 0, 2},
                  {1, 2, 0}, {2, 0, 1}, {2, 1, 0}};
long long dist(int a, int b) {
  long long x = point2[a][0] - point2[b][0], y = point2[a][1] - point2[b][1],
            z = point2[a][2] - point2[b][2];
  return x * x + y * y + z * z;
}
long long cross_product(vector<long long> p1, vector<long long> p2) {
  return p1[0] * p2[0] + p1[1] * p2[1] + p1[2] * p2[2];
}
bool check2(int i, int j, int p) {
  vector<long long> arr[2];
  arr[0] = {point2[j][0] - point2[i][0], point2[j][1] - point2[i][1],
            point2[j][2] - point2[i][2]};
  arr[1] = {point2[p][0] - point2[i][0], point2[p][1] - point2[i][1],
            point2[p][2] - point2[i][2]};
  return cross_product(arr[0], arr[1]) == 0;
}
bool check() {
  long long len = LLONG_MAX;
  for (int i = 0; i < 8; i++)
    for (int j = i + 1; j < 8; j++) len = min(len, dist(i, j));
  int count[3] = {};
  for (int i = 0; i < 8; i++) {
    int cnt = 0;
    for (int j = 0; j < 8; j++) {
      long long t = dist(i, j);
      if (t == len) count[0]++, cnt++;
      if (t == len * 2) count[1]++;
      if (t == len * 3) count[2]++;
    }
    if (cnt != 3) return false;
  }
  return count[0] == 8 * 3 && count[1] == 8 * 3 && count[2] == 8;
}
void rec(int i = 0) {
  if (i == 8) {
    if (check()) {
      printf("YES\n");
      for (int j = 0; j < 8; j++)
        printf("%lld %lld %lld\n", point2[j][0], point2[j][1], point2[j][2]);
      exit(0);
    }
    return;
  }
  for (int j = 0; j < 6; j++) {
    int a = perm[j][0], b = perm[j][1], c = perm[j][2];
    point2[i][0] = point[i][a];
    point2[i][1] = point[i][b];
    point2[i][2] = point[i][c];
    rec(i + 1);
  }
}
int main() {
  for (int i = 0; i < 8; i++)
    scanf("%lld %lld %lld", &point[i][0], &point[i][1], &point[i][2]);
  rec();
  printf("NO");
  fprintf(stderr, "%.7lf\n", (double)clock() / CLOCKS_PER_SEC);
  return 0;
}
