#include <bits/stdc++.h>
using namespace std;
vector<vector<long long>> all;
struct Vector {
  long long _x, _y, _z;
  Vector(long long x, long long y, long long z) : _x(x), _y(y), _z(z) {}
  Vector(vector<long long> const &v) : _x(v[0]), _y(v[1]), _z(v[2]) {}
  Vector operator-(Vector const &v) const {
    return Vector(v._x - _x, v._y - _y, v._z - _z);
  }
  long long sq_dist() const { return (_x * _x + _y * _y + _z * _z); }
  long long operator*(Vector const &v) const {
    return _x * v._x + _y * v._y + _z * v._z;
  }
  bool operator<(Vector const &v) const {
    if (_x == v._x) {
      if (_y == v._y) return _z < v._z;
      return _y < v._y;
    }
    return _x < v._x;
  }
};
void solve() {
  for (int i = 0; i != 8; ++i) {
    vector<pair<long long, Vector>> vecs;
    for (int j = 0; j != 8; ++j)
      if (i != j) {
        if (all[i] == all[j]) return;
        Vector curr = Vector(all[j]) - Vector(all[i]);
        vecs.push_back(make_pair(curr.sq_dist(), curr));
      }
    sort(vecs.begin(), vecs.end());
    if ((vecs[0].first != vecs[1].first || vecs[0].first != vecs[2].first ||
         vecs[0].second * vecs[1].second != 0 ||
         vecs[1].second * vecs[2].second != 0 ||
         vecs[2].second * vecs[0].second != 0))
      return;
  }
  cout << "YES\n";
  for (auto &i : all) {
    for (auto &j : i) cout << j << ' ';
    cout << '\n';
  }
  exit(0);
}
void gen_all_perm(int n = 0) {
  if (n == 7) {
    solve();
    return;
  }
  do {
    gen_all_perm(n + 1);
  } while (next_permutation(all[n].begin(), all[n].end()));
}
int main() {
  ios_base::sync_with_stdio(false);
  all.resize(8, vector<long long>(3));
  for (auto &i : all) {
    for (auto &j : i) cin >> j;
    sort(i.begin(), i.end());
  }
  gen_all_perm();
  cout << "NO\n";
  return 0;
}
