#include <bits/stdc++.h>
using namespace std;
struct point {
  long long x, y, z;
  point operator+(const point &p) const {
    point tp;
    tp.x = x + p.x;
    tp.y = y + p.y;
    tp.z = z + p.z;
    return tp;
  }
  point operator-(const point &p) const {
    point tp;
    tp.x = x - p.x;
    tp.y = y - p.y;
    tp.z = z - p.z;
    return tp;
  }
};
point a[8];
point p;
int cnt, ocnt;
int inds[8], oind[8];
inline long long dis(const point &p0, const point &p1) {
  return ((p0.x - p1.x) * (p0.x - p1.x)) + ((p0.y - p1.y) * (p0.y - p1.y)) +
         ((p0.z - p1.z) * (p0.z - p1.z));
}
inline long long dot(const point &p0, const point &p1) {
  return p0.x * p1.x + p0.y * p1.y + p0.z * p1.z;
}
bool is_valid() {
  cnt = ocnt = 0;
  long long minv = -1, cl;
  for (int i = 1; i < 8; i++) {
    cl = dis(a[0], a[i]);
    if (cl == 0) return false;
    if (minv == -1 || cl < minv) {
      for (int j = 1; j <= cnt; j++) oind[++ocnt] = inds[j];
      minv = cl;
      cnt = 1;
      inds[cnt] = i;
    } else if (cl == minv) {
      inds[++cnt] = i;
    } else {
      oind[++ocnt] = i;
    }
  }
  if (cnt != 3) return false;
  if (dot(a[inds[2]], a[inds[1]]) != 0) return false;
  if (dot(a[inds[3]], a[inds[1]]) != 0) return false;
  if (dot(a[inds[3]], a[inds[2]]) != 0) return false;
  bool flag;
  for (int c = 1; c <= 4; c++) {
    if (c == 1)
      p = a[inds[2]] + a[inds[1]];
    else if (c == 2)
      p = a[inds[1]] + a[inds[3]];
    else if (c == 3)
      p = a[inds[3]] + a[inds[2]];
    else if (c == 4)
      p = a[inds[1]] + a[inds[3]] + a[inds[2]];
    flag = false;
    for (int i = 1; i <= ocnt; i++) {
      int j = oind[i];
      if (p.x == a[j].x && p.y == a[j].y && p.z == a[j].z) {
        flag = true;
        break;
      }
    }
    if (!flag) return false;
  }
  return true;
}
bool check(int cur) {
  if (cur == 8) {
    point p = a[0];
    for (int i = 0; i < 8; i++) a[i] = a[i] - p;
    bool flag = is_valid();
    for (int i = 0; i < 8; i++) a[i] = a[i] + p;
    return flag;
  }
  if (check(cur + 1)) return true;
  swap(a[cur].y, a[cur].z);
  if (check(cur + 1)) return true;
  swap(a[cur].x, a[cur].z);
  if (check(cur + 1)) return true;
  swap(a[cur].y, a[cur].z);
  if (check(cur + 1)) return true;
  swap(a[cur].x, a[cur].z);
  if (check(cur + 1)) return true;
  swap(a[cur].y, a[cur].z);
  if (check(cur + 1)) return true;
  swap(a[cur].x, a[cur].z);
  return false;
}
int main() {
  for (int i = 0; i < 8; i++)
    scanf("%I64d %I64d %I64d", &a[i].x, &a[i].y, &a[i].z);
  if (check(1)) {
    printf("YES\n");
    for (int i = 0; i < 8; i++)
      printf("%I64d %I64d %I64d\n", a[i].x, a[i].y, a[i].z);
  } else
    printf("NO\n");
}
