#include <bits/stdc++.h>
using namespace std;
long long sqr(int a) { return (long long)a * (long long)a; }
vector<int> c1[8];
bool isCube() {
  long long d[28];
  int l = 0;
  for (int k = 0; k < 8; k++)
    for (int i = k + 1; i < 8; i++) {
      d[l] = sqr(c1[k][0] - c1[i][0]) + sqr(c1[k][1] - c1[i][1]) +
             sqr(c1[k][2] - c1[i][2]);
      if (d[l] == 0) return false;
      l++;
    }
  long long x = d[0];
  for (int k = 1; k < 28; k++) x = min(x, d[k]);
  int niza[3] = {0, 0, 0};
  for (int k = 0; k < 28; k++)
    if (d[k] != x && d[k] != x * 2 && d[k] != x * 3)
      return false;
    else {
      niza[d[k] / x - 1]++;
    }
  if (niza[0] == 12 && niza[1] == 12) {
    cout << "YES" << endl;
    for (int k = 0; k < 8; k++)
      cout << c1[k][0] << " " << c1[k][1] << " " << c1[k][2] << endl;
    return true;
  } else
    return false;
}
int main() {
  int a, b, c;
  vector<vector<int> > niza[8];
  for (int k = 0; k < 8; k++) {
    vector<int> tmp;
    cin >> a >> b >> c;
    tmp.push_back(a);
    tmp.push_back(b);
    tmp.push_back(c);
    sort(tmp.begin(), tmp.end());
    niza[k].push_back(tmp);
    while (next_permutation(tmp.begin(), tmp.end())) niza[k].push_back(tmp);
  }
  int j, t;
  for (int k = 0; k < 1679616; k++) {
    t = k;
    for (int i = 0; i < 8; i++) {
      j = t % 6;
      t /= 6;
      if (niza[i].size() <= j)
        goto st;
      else
        c1[i] = niza[i][j];
    }
    if (isCube()) return 0;
  st:;
  }
  cout << "NO" << endl;
  return 0;
}
