#include <bits/stdc++.h>
using namespace std;
const long long MAX = 2e5, inf = (1LL << 50);
int cor[8][3];
set<vector<int>> point;
inline long long sqDis(int* a, int* b) {
  return ((long long)(a[0] - b[0]) * (a[0] - b[0])) +
         ((long long)(a[1] - b[1]) * (a[1] - b[1])) +
         ((long long)(a[2] - b[2]) * (a[2] - b[2]));
}
inline bool check() {
  long long len = inf;
  for (int i = 0; i < 8; i++) {
    for (int j = i + 1; j < 8; j++) {
      len = min(len, sqDis(cor[i], cor[j]));
    }
  }
  int side = 0, fdiag = 0, diag = 0;
  for (int i = 0; i < 8; i++) {
    for (int j = i + 1; j < 8; j++) {
      long long dis = sqDis(cor[i], cor[j]);
      if (dis == len)
        side++;
      else if (dis == 2 * len)
        fdiag++;
      else if (dis == 3 * len)
        diag++;
    }
  }
  return side == 12 && fdiag == 12 && diag == 4;
}
bool perm(int i) {
  if (i == 8) return check();
  do {
    if (perm(i + 1)) return true;
  } while (next_permutation(cor[i], cor[i] + 3));
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  for (int i = 0; i < 8; i++) {
    for (int j = 0; j < 3; j++) {
      cin >> cor[i][j];
    }
    sort(cor[i], cor[i] + 3);
  }
  if (perm(0)) {
    cout << "YES" << '\n';
    for (int i = 0; i < 8; i++) {
      for (int j = 0; j < 3; j++) {
        cout << cor[i][j];
        if (j != 2)
          cout << " ";
        else
          cout << '\n';
      }
    }
  } else {
    cout << "NO" << '\n';
  }
  return 0;
}
