#include <bits/stdc++.h>
long long permutation[6][3] = {{0, 1, 2}, {0, 2, 1}, {1, 0, 2},
                               {1, 2, 0}, {2, 0, 1}, {2, 1, 0}};
long long coord[8][3];
long long coord2[8][3];
bool chosen[8];
bool chosen2[8];
long long position[8];
bool recur3() {
  for (long long k = 4; k < 8; ++k) {
    chosen2[k] = false;
  }
  for (long long k = 0; k < 3; ++k) {
    coord2[4][k] = (coord2[2][k] - coord2[0][k]) +
                   (coord2[3][k] - coord2[0][k]) + coord2[0][k];
  }
  for (long long k = 0; k < 3; ++k) {
    coord2[5][k] = (coord2[3][k] - coord2[0][k]) +
                   (coord2[1][k] - coord2[0][k]) + coord2[0][k];
  }
  for (long long k = 0; k < 3; ++k) {
    coord2[6][k] = (coord2[1][k] - coord2[0][k]) +
                   (coord2[2][k] - coord2[0][k]) + coord2[0][k];
  }
  for (long long k = 0; k < 3; ++k) {
    coord2[7][k] = (coord2[1][k] - coord2[0][k]) +
                   (coord2[2][k] - coord2[0][k]) +
                   (coord2[3][k] - coord2[0][k]) + coord2[0][k];
  }
  for (long long k = 0; k < 8; ++k) {
    if (!chosen[k]) {
      bool good = false;
      for (long long j = 4; j < 8; ++j) {
        if (chosen2[j]) continue;
        for (long long i = 0; i < 6; ++i) {
          bool flag = true;
          for (long long h = 0; h < 3; ++h) {
            if (coord[k][h] != coord2[j][permutation[i][h]]) {
              flag = false;
              break;
            }
          }
          if (flag) {
            good = true;
            break;
          }
        }
        if (good) {
          chosen2[j] = true;
          position[k] = j;
          break;
        }
      }
      if (!good) {
        return false;
      }
    }
  }
  return true;
}
long long dprod(long long *a, long long *b, long long *c) {
  long long ans = 0;
  for (long long k = 0; k < 3; ++k) {
    ans += (a[k] - c[k]) * (b[k] - c[k]);
  }
  return ans;
}
bool recur2(long long level = 1, long long last = 0) {
  if (level == 4) {
    if (dprod(coord2[1], coord2[2], coord2[0]) ||
        dprod(coord2[2], coord2[3], coord2[0]) ||
        dprod(coord2[3], coord2[1], coord2[0]))
      return false;
    if (dprod(coord2[1], coord2[1], coord2[0]) !=
            dprod(coord2[2], coord2[2], coord2[0]) ||
        dprod(coord2[1], coord2[1], coord2[0]) !=
            dprod(coord2[3], coord2[3], coord2[0]) ||
        dprod(coord2[1], coord2[1], coord2[0]) == 0)
      return false;
    return recur3();
  }
  for (long long k = last + 1; k < 8; ++k) {
    chosen[k] = true;
    for (long long j = 0; j < 6; ++j) {
      for (long long i = 0; i < 3; ++i) {
        coord2[level][i] = coord[k][permutation[j][i]];
      }
      position[k] = level;
      if (recur2(level + 1, k)) return true;
    }
    chosen[k] = false;
  }
  return false;
}
bool recur1() {
  for (long long k = 0; k < 3; ++k) {
    coord2[0][k] = coord[0][k];
  }
  chosen[0] = true;
  position[0] = 0;
  if (recur2()) return true;
  chosen[0] = false;
  return false;
}
int main() {
  for (int k = 0; k < 8; ++k) {
    for (int j = 0; j < 3; ++j) {
      std::cin >> coord[k][j];
    }
  }
  if (recur1()) {
    std::cout << "YES\n";
    for (int k = 0; k < 8; ++k) {
      for (int j = 0; j < 3; ++j) {
        std::cout << coord2[position[k]][j] << ' ';
      }
      std::cout << '\n';
    }
  } else {
    std::cout << "NO\n";
  }
  return 0;
}
