#include <bits/stdc++.h>
using namespace std;
int GCD(int a, int b) {
  if (!a) return b;
  return GCD(b % a, a);
}
vector<vector<int>> points(8, vector<int>(3));
vector<vector<int>> ans;
long long dist(int p1, int &p2) {
  int x1 = points[p1][0], y1 = points[p1][1], z1 = points[p1][2];
  int x2 = points[p2][0], y2 = points[p2][1], z2 = points[p2][2];
  long long ret = 0;
  ret += (x1 - x2) * (long long)(x1 - x2);
  ret += (y1 - y2) * (long long)(y1 - y2);
  ret += (z1 - z2) * (long long)(z1 - z2);
  return ret;
}
bool trt = false;
vector<long long> D(64);
bool ok() {
  D.clear();
  long long d1 = 0, d2 = 0;
  for (int i = (0); i < (int)(8); i++) {
    for (int j = (i + 1); j < (int)(8); j++) {
      long long d = dist(i, j);
      D.push_back(d);
      if (d >= d1) {
        d1 = d;
      } else if (d >= d2) {
        d2 = d;
      }
    }
  }
  if (!d1 || !d2) return false;
  int cd1, cd2, cd3;
  cd1 = cd2 = cd3 = 0;
  for (int i = (0); i < (int)(D.size()); i++) {
    if (D[i] == d1)
      cd1++;
    else if (D[i] == d2)
      cd2++;
  }
  if (cd2 != 12) return false;
  if (cd1 != 4) return false;
  return true;
}
int go(int at) {
  if (trt) return 0;
  if (at == 8) {
    if (ok()) {
      ans = points;
      trt = true;
    }
    return 0;
  }
  do {
    go(at + 1);
  } while (next_permutation(points[at].begin(), points[at].end()));
  return 0;
}
int main() {
  clock_t startTime = clock();
  ios_base::sync_with_stdio(true);
  for (int i = (0); i < (int)(8); i++) {
    for (int j = (0); j < (int)(3); j++) cin >> points[i][j];
    sort(points[i].begin(), points[i].end());
  }
  go(0);
  if (trt) {
    cout << "YES\n";
    for (int i = (0); i < (int)(8); i++) {
      for (int j = (0); j < (int)(3); j++) cout << ans[i][j] << " ";
      cout << "\n";
    }
  } else
    cout << "NO\n";
  clock_t endTime = clock();
  cerr << "\nTime:" << double(endTime - startTime) / CLOCKS_PER_SEC
       << " seconds\n";
  return 0;
}
