#include <bits/stdc++.h>
using namespace std;
long long x[8][3];
long long y[8][3];
int a[8];
vector<long long> vec[8];
bool check() {
  for (int i = 0; i < 8; i++) {
    vec[i].clear();
    for (int j = 0; j < 8; j++)
      vec[i].push_back((y[i][0] - y[j][0]) * (y[i][0] - y[j][0]) +
                       (y[i][1] - y[j][1]) * (y[i][1] - y[j][1]) +
                       (y[i][2] - y[j][2]) * (y[i][2] - y[j][2]));
    sort(vec[i].begin(), vec[i].end());
  }
  for (int i = 0; i < 8; i++) {
    if (!vec[i][1]) return false;
    long long mn = vec[i][1];
    if (mn != vec[i][2] || mn != vec[i][3]) return false;
    mn *= 2;
    if (mn != vec[i][4] || mn != vec[i][5] || mn != vec[i][6]) return false;
    mn = mn / 2 * 3;
    if (mn != vec[i][7]) return false;
  }
  return true;
}
int main() {
  srand(time(0));
  ios_base::sync_with_stdio(0);
  for (int i = 0; i < 8; i++)
    for (int j = 0; j < 3; j++) cin >> x[i][j];
  a[7] = -1;
  while (true) {
    a[7]++;
    for (int i = 7; i > 1; i--) {
      a[i - 1] += a[i] / 6;
      a[i] %= 6;
    }
    if (a[1] > 6) break;
    for (int i = 0; i < 3; i++) y[0][i] = x[0][i];
    for (int i = 1; i < 8; i++) {
      if (a[i] < 2) {
        y[i][0] = x[i][0];
        if (a[i]) {
          y[i][1] = x[i][2];
          y[i][2] = x[i][1];
        } else {
          y[i][2] = x[i][2];
          y[i][1] = x[i][1];
        }
        continue;
      }
      if (a[i] < 4) {
        y[i][0] = x[i][1];
        if (a[i] == 2) {
          y[i][1] = x[i][0];
          y[i][2] = x[i][2];
        } else {
          y[i][2] = x[i][0];
          y[i][1] = x[i][2];
        }
        continue;
      }
      if (a[i] < 6) {
        y[i][0] = x[i][2];
        if (a[i] == 4) {
          y[i][1] = x[i][0];
          y[i][2] = x[i][1];
        } else {
          y[i][2] = x[i][0];
          y[i][1] = x[i][1];
        }
        continue;
      }
    }
    if (check()) {
      cout << "YES" << endl;
      for (int i = 0; i < 8; i++)
        cout << y[i][0] << ' ' << y[i][1] << ' ' << y[i][2] << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
}
