#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:36777216")
using namespace std;
const int MAXN = 10007;
const int MINN = 1007;
const long long INF = 8000000;
const int MOD = (int)1e9 + 7;
const double eps = 1e-9;
const int N = 8;
vector<vector<int> > A;
bool pros() {
  vector<long long> dist;
  for (int i = 0; i < N; i++)
    for (int j = i + 1; j < N; j++) {
      long long d = 0;
      for (int k = 0; k < 3; k++)
        d += (long long)(A[i][k] - A[j][k]) * (A[i][k] - A[j][k]);
      dist.push_back(d);
    }
  sort(dist.begin(), dist.end());
  if (dist[0] == 0) return 0;
  for (int i = 0; i < 12; i++)
    if (dist[i] != dist[0]) return 0;
  if (dist[0] == dist[12]) return 0;
  for (int i = 13; i < 24; i++)
    if (dist[i] != dist[12]) return 0;
  if (dist[24] == dist[12]) return 0;
  for (int i = 25; i < 28; i++)
    if (dist[i] != dist[24]) return 0;
  return 1;
}
bool dfs(int n) {
  if (n == N) return pros();
  do {
    if (dfs(n + 1)) return 1;
  } while (next_permutation(A[n].begin(), A[n].end()));
  return 0;
}
int k;
int main() {
  for (int i = 0; i < N; i++) {
    vector<int> a;
    for (int j = 0; j < 3; j++) {
      cin >> k;
      a.push_back(k);
    }
    sort(a.begin(), a.end());
    A.push_back(a);
  }
  if (!dfs(1)) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < 3; j++) cout << A[i][j] << " ";
    cout << endl;
  }
}
