#include <bits/stdc++.h>
using namespace std;
template <class T>
void debug(T a, T b) {
  ;
}
template <class T>
void chmin(T& a, const T& b) {
  if (a > b) a = b;
}
template <class T>
void chmax(T& a, const T& b) {
  if (a < b) a = b;
}
namespace std {
template <class S, class T>
ostream& operator<<(ostream& out, const pair<S, T>& a) {
  out << '(' << a.first << ',' << a.second << ')';
  return out;
}
}  // namespace std
long long int readL() {
  long long int res;
  scanf("%I64d", &res);
  return res;
}
void printL(long long int res) { printf("%I64d", res); }
vector<long long int> ps[10];
vector<long long int> res[10];
vector<long long int> adj[4], other[4];
int n = 8;
vector<long long int> calc(vector<long long int> a, vector<long long int> b,
                           vector<long long int> c) {
  vector<long long int> res(3);
  for (int i = 0; i < (3); ++i) res[i] = a[i] + b[i] - c[i];
  return res;
}
bool same(vector<long long int> a, vector<long long int> b) {
  sort((a).begin(), (a).end());
  sort((b).begin(), (b).end());
  return a == b;
}
void print() {
  puts("YES");
  int used[8] = {0};
  for (int i = 0; i < (8); ++i) {
    for (int j = 0; j < (8); ++j)
      if (!used[j] && same(res[j], ps[i])) {
        printf("%d %d %d\n", (int)res[j][0], (int)res[j][1], (int)res[j][2]);
        used[j] = 1;
        break;
      }
  }
  exit(0);
}
void check() {
  vector<long long int> want[4];
  want[0] = calc(adj[1], adj[2], adj[0]);
  want[1] = calc(adj[2], adj[3], adj[0]);
  want[2] = calc(adj[1], adj[3], adj[0]);
  want[3] = calc(want[0], adj[3], adj[0]);
  int perm[4] = {0, 1, 2, 3};
  do {
    int fail = 0;
    for (int i = 0; i < (4); ++i)
      if (!same(other[perm[i]], want[i])) fail = 1;
    if (!fail) {
      for (int i = 0; i < (4); ++i) res[i] = adj[i];
      for (int i = 0; i < (4); ++i) res[i + 4] = want[i];
      print();
    }
  } while (next_permutation(perm, perm + 4));
}
vector<long long int> subt(vector<long long int> a, vector<long long int> b) {
  vector<long long int> res(3);
  for (int i = 0; i < (3); ++i) res[i] = a[i] - b[i];
  return res;
}
long long int dot(vector<long long int> a, vector<long long int> b) {
  long long int res = 0;
  for (int i = 0; i < (3); ++i) res += a[i] * b[i];
  return res;
}
long long int len(vector<long long int> a) {
  long long int res = 0;
  for (int i = 0; i < (3); ++i) res += a[i] * a[i];
  return res;
}
void dfs(int ind) {
  if (ind == 4) {
    vector<long long int> a = subt(adj[1], adj[0]), b = subt(adj[2], adj[0]),
                          c = subt(adj[3], adj[0]);
    if (dot(a, b) || dot(b, c) || dot(c, a) || len(a) != len(b) ||
        len(b) != len(c) || len(c) != len(a) || len(a) == 0)
      ;
    else
      check();
    return;
  }
  sort((adj[ind]).begin(), (adj[ind]).end());
  do {
    dfs(ind + 1);
  } while (next_permutation((adj[ind]).begin(), (adj[ind]).end()));
}
int main() {
  for (int i = 0; i < (n); ++i) {
    ps[i].resize(3);
    for (int j = 0; j < (3); ++j) cin >> ps[i][j];
  }
  int perm[7] = {0};
  for (int i = 0; i < (3); ++i) perm[6 - i] = 1;
  do {
    int cnt = 0;
    adj[cnt++] = ps[0];
    for (int i = 0; i < (7); ++i)
      if (perm[i]) adj[cnt++] = ps[i + 1];
    cnt = 0;
    for (int i = 0; i < (7); ++i)
      if (!perm[i]) other[cnt++] = ps[i + 1];
    dfs(0);
  } while (next_permutation(perm, perm + 7));
  puts("NO");
  return 0;
}
