#include <bits/stdc++.h>
using namespace std;
struct debug_t {
  template <typename T>
  debug_t& operator<<(const T& value) {
    return *this;
  }
} debug;
struct Point {
  int x, y, z;
  Point() {}
  Point(const Point& p) : x(p.x), y(p.y), z(p.z) {}
  Point(int x, int y, int z) : x(x), y(y), z(z) {}
  double sqr_dist(const Point& p) const {
    return ((p.x - double(x)) * (p.x - double(x))) +
           ((p.y - double(y)) * (p.y - double(y))) +
           ((p.z - double(z)) * (p.z - double(z)));
  }
  double dist(const Point& p) const { return sqrt(sqr_dist(p)); }
  Point operator+(const Point& p) const {
    return Point(x + p.x, y + p.y, z + p.z);
  }
  Point operator-(const Point& p) const {
    return Point(x - p.x, y - p.y, z - p.z);
  }
  bool operator==(const Point& p) const {
    return x == p.x && y == p.y && z == p.z;
  }
};
bool is_cube(vector<Point>& p) {
  for (int i = 1; i < int((p).size()) - 1; i++)
    for (int j = i + 1; j < int((p).size()); j++)
      if (p[i].sqr_dist(p[0]) > p[j].sqr_dist(p[0])) swap(p[i], p[j]);
  for (int i = 0; i < (8); ++i)
    for (int j = 0; j < (8); ++j)
      if (i != j && p[i] == p[j]) return false;
  double a, b, c;
  a = p[0].sqr_dist(p[1]);
  b = p[0].sqr_dist(p[2]);
  c = p[0].sqr_dist(p[3]);
  if (!(((a) > (b) ? (a) - (b) : (b) - (a)) <= 1e-8) ||
      !(((b) > (c) ? (b) - (c) : (c) - (b)) <= 1e-8) ||
      !(((a) > (c) ? (a) - (c) : (c) - (a)) <= 1e-8))
    return false;
  Point aa((p[1] - p[0]) + (p[2] - p[0]) + p[0]);
  Point bb((p[2] - p[0]) + (p[3] - p[0]) + p[0]);
  Point cc((p[1] - p[0]) + (p[3] - p[0]) + p[0]);
  if (find((p).begin(), (p).end(), aa) == p.end() ||
      find((p).begin(), (p).end(), bb) == p.end() ||
      find((p).begin(), (p).end(), cc) == p.end()) {
    return false;
  }
  a = p[0].sqr_dist(aa);
  b = p[0].sqr_dist(bb);
  c = p[0].sqr_dist(cc);
  if (!(((a) > (b) ? (a) - (b) : (b) - (a)) <= 1e-8) ||
      !(((b) > (c) ? (b) - (c) : (c) - (b)) <= 1e-8) ||
      !(((a) > (c) ? (a) - (c) : (c) - (a)) <= 1e-8))
    return false;
  a = p[7].sqr_dist(aa);
  b = p[7].sqr_dist(bb);
  c = p[7].sqr_dist(cc);
  if (!(((a) > (b) ? (a) - (b) : (b) - (a)) <= 1e-8) ||
      !(((b) > (c) ? (b) - (c) : (c) - (b)) <= 1e-8) ||
      !(((a) > (c) ? (a) - (c) : (c) - (a)) <= 1e-8))
    return false;
  return true;
}
bool is_cube(const vector<vector<int> >& coord,
             const vector<vector<int> >& perm) {
  vector<Point> t(8);
  for (int i = 0; i < (8); ++i) {
    t[i].x = coord[i][perm[i][0]];
    t[i].y = coord[i][perm[i][1]];
    t[i].z = coord[i][perm[i][2]];
  }
  return is_cube(t);
}
void nxt_perm(vector<vector<int> >& perm, int pos = 7) {
  if (pos < 0) return;
  next_permutation((perm[pos]).begin(), (perm[pos]).end());
  if (perm[pos][0] == 0 && perm[pos][1] == 1 && perm[pos][2] == 2)
    nxt_perm(perm, pos - 1);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  while (true) {
    vector<vector<int> > cur(8, vector<int>(3));
    bool inp_ok = true;
    for (int i = 0; i < (8); ++i)
      for (int j = 0; j < (3); ++j)
        if (!(cin >> cur[i][j])) {
          inp_ok = false;
        }
    if (!inp_ok) break;
    vector<vector<int> > perm(8, vector<int>(3));
    for (int i = 0; i < (8); ++i)
      for (int j = 0; j < (3); ++j) perm[i][j] = j;
    bool solution_ex = false;
    int cnt = 6 * 6 * 6 * 6 * 6 * 6 * 6 * 6;
    for (int mask = 0; mask < (cnt); ++mask) {
      if (is_cube(cur, perm)) {
        cout << "YES"
             << "\n";
        for (int i = 0; i < (8); ++i) {
          for (int j = 0; j < (3); ++j) cout << cur[i][perm[i][j]] << " ";
          cout << "\n";
        }
        solution_ex = true;
        break;
      }
      nxt_perm(perm);
    }
    if (!solution_ex)
      cout << "NO"
           << "\n";
  }
  return 0;
}
