#include <bits/stdc++.h>
using namespace std;
long long m[8][3];
map<long long int, int> s;
int q = 0;
long long quad(long long x) { return x * x; }
bool calc() {
  s.clear();
  for (int i = 0; i < 8; i++) {
    for (int j = i + 1; j < 8; j++) {
      s[quad(m[i][0] - m[j][0]) + quad(m[i][1] - m[j][1]) +
        quad(m[i][2] - m[j][2])]++;
    }
  }
  if (s.size() != 3) return false;
  vector<pair<long long, int> > v;
  map<long long int, int>::iterator it;
  it = s.begin();
  while (it != s.end()) {
    v.push_back(*it);
    it++;
  }
  sort(v.begin(), v.end());
  return (2 * v[0].first == v[1].first && 3 * v[0].first == v[2].first &&
          v[0].second == 12 && v[1].second == 12 && v[2].second == 4);
}
void rec(int level) {
  if (level == 8) {
    if (calc()) {
      printf("YES\n");
      for (int i = 0; i < 8; i++) {
        for (int j = 0; j < 3; j++) {
          printf("%lld ", m[i][j]);
        }
        printf("\n");
      }
      exit(0);
    }
    return;
  }
  do {
    rec(level + 1);
  } while (next_permutation(m[level], m[level] + 3));
}
int main() {
  for (int i = 0; i < 8; i++) {
    for (int j = 0; j < 3; j++) {
      scanf("%lld", &m[i][j]);
    }
    sort(m[i], m[i] + 3);
  }
  rec(1);
  printf("NO\n");
  return 0;
}
