#include <bits/stdc++.h>
using namespace std;
using LL = int64_t;
const int INF = 0x3fffffff;
const double EPS = 1e-9;
const double PI = 2 * asin(1);
set<LL> stll;
vector<vector<int>> vvi;
void pretreat() {}
bool input() {
  int x, y, z;
  for (int i = 0; i < 8; ++i) {
    scanf("%d%d%d", &x, &y, &z);
    vector<int> vi_t{x, y, z};
    sort(vi_t.begin(), vi_t.end());
    vvi.push_back(vi_t);
  }
  return true;
}
LL dist(vector<int> &vi_a, vector<int> &vi_b) {
  return (LL)(vi_a[0] - vi_b[0]) * (vi_a[0] - vi_b[0]) +
         (LL)(vi_a[1] - vi_b[1]) * (vi_a[1] - vi_b[1]) +
         (LL)(vi_a[2] - vi_b[2]) * (vi_a[2] - vi_b[2]);
}
void dfs(int k) {
  if (k == 8) {
    stll.clear();
    for (int i = 0; i < 8; ++i) {
      for (int j = 0; j < 8; ++j) {
        if (i == j) continue;
        stll.emplace(dist(vvi[i], vvi[j]));
        if (stll.size() > 3) break;
      }
    }
    if (stll.size() == 3) {
      puts("YES");
      for (auto &v : vvi) printf("%d %d %d\n", v[0], v[1], v[2]);
      exit(0);
    }
    return;
  }
  do {
    dfs(k + 1);
  } while (next_permutation(vvi[k].begin(), vvi[k].end()));
}
void solve() {
  dfs(1);
  puts("NO");
}
int main() {
  pretreat();
  input();
  solve();
  return 0;
}
