#include <bits/stdc++.h>
using namespace std;
int c[8][3];
bool read() {
  for (int i = 0; i < int(8); ++i)
    for (int j = 0; j < int(3); ++j) cin >> c[i][j];
  return true;
}
double dist[100];
int t[8];
int p[6][3];
double getDist(int i, int j) {
  double dx = c[i][p[t[i]][0]] - c[j][p[t[j]][0]];
  double dy = c[i][p[t[i]][1]] - c[j][p[t[j]][1]];
  double dz = c[i][p[t[i]][2]] - c[j][p[t[j]][2]];
  return (dx * dx + dy * dy + dz * dz);
}
double dif[] = {1, (2.0), (3.0)};
double cdist[8][8];
bool check() {
  int sz = 0;
  for (int i = 0; i < int(8); ++i)
    for (int j = 0; j < int(i); ++j) dist[sz++] = cdist[i][j];
  sort(dist, dist + sz);
  if (dist[0] < 1e-8) return false;
  if (fabs(dist[11] / dist[0] - dif[0]) > 1e-8) return false;
  if (fabs(dist[23] / dist[0] - dif[1]) > 1e-8) return false;
  if (fabs(dist[12] / dist[0] - dif[1]) > 1e-8) return false;
  if (fabs(dist[24] / dist[0] - dif[2]) > 1e-8) return false;
  if (fabs(dist[27] / dist[0] - dif[2]) > 1e-8) return false;
  return true;
}
bool inc() {
  int r = 7;
  while (r >= 0 && ++t[r] == 6) {
    t[r] = 0;
    r--;
  }
  if (r == -1) return false;
  for (int i = r; i < 8; ++i)
    for (int j = 0; j < int(i); ++j) cdist[i][j] = getDist(i, j);
  return true;
}
void rec() {
  for (int i = 0; i < int(8); ++i)
    for (int j = 0; j < int(i); ++j) cdist[i][j] = getDist(i, j);
  while (inc()) {
    if (check()) {
      cout << "YES" << endl;
      for (int i = 0; i < int(8); ++i) {
        for (int j = 0; j < int(3); ++j) cout << c[i][p[t[i]][j]] << ' ';
        cout << endl;
      }
      exit(0);
    }
  }
}
void solve() {
  vector<int> v;
  for (int i = 0; i < int(3); ++i) v.push_back(i);
  int csz = 0;
  do {
    for (int j = 0; j < int(3); ++j) p[csz][j] = v[j];
    csz++;
  } while (next_permutation(v.begin(), v.end()));
  rec();
  cout << "NO" << endl;
}
int main() {
  read();
  solve();
  return 0;
}
