#include <bits/stdc++.h>
using namespace std;
struct Point {
  int x[3];
};
template <typename T>
inline T sqr(const T a) {
  return a * a;
}
bool operator<(Point a, Point b) {
  if (a.x[0] == b.x[0]) {
    if (a.x[1] == b.x[1]) {
      return a.x[2] < b.x[2];
    } else
      return a.x[1] < b.x[1];
  } else
    return a.x[0] < b.x[0];
}
vector<Point> points(8);
vector<long long> ds(28);
bool check() {
  int k = 0;
  for (int i = 0; i < ds.size(); i++) ds[i] = 0;
  for (int i = 0; i < 8; i++) {
    for (int j = i + 1; j < 8; j++) {
      for (int m = 0; m < 3; m++)
        ds[k] += sqr<long long>(points[i].x[m] - points[j].x[m]);
      k++;
    }
  }
  long long x = *min_element(ds.begin(), ds.end());
  if (x == 0) return false;
  bool a =
      count_if(ds.begin(), ds.end(), bind1st(equal_to<long long>(), x)) == 12;
  if (!a) {
    return false;
  }
  bool b = count_if(ds.begin(), ds.end(),
                    bind1st(equal_to<long long>(), x * 2)) == 12;
  if (!b) {
    return false;
  }
  bool c = count_if(ds.begin(), ds.end(),
                    bind1st(equal_to<long long>(), 3 * x)) == 4;
  return c;
}
void solve(int index) {
  if (index == 8) {
    if (check()) {
      cout << "YES\n";
      for (Point& p : points) {
        cout << p.x[0] << ' ' << p.x[1] << ' ' << p.x[2] << '\n';
      }
      exit(0);
    }
    return;
  }
  sort(points[index].x, points[index].x + 3);
  do {
    solve(index + 1);
  } while (next_permutation(points[index].x, points[index].x + 3));
}
int main() {
  ios::sync_with_stdio(false);
  for (int i = 0; i < 8; i++) {
    for (int j = 0; j < 3; j++) {
      cin >> points[i].x[j];
    }
  }
  solve(0);
  cout << "NO\n";
  return 0;
}
