#include <bits/stdc++.h>
using namespace std;
long long cube[8][3][6];
int p[3][6], ti[8];
long long d[3];
int dc[3], checkedOrder, permOk;
int main() {
  for (int i = 0; i < 6; i++) {
    p[0][i] = i >> 1;
    p[1][i] = (p[0][i] + (i & 1) + 1) % 3;
    p[2][i] = 3 - p[0][i] - p[1][i];
  }
  for (int i = 0; i < 8; i++) {
    cin >> cube[i][0][0] >> cube[i][1][0] >> cube[i][2][0];
  }
  for (int i = 0; i < 8; i++) {
    for (int j = 1; j < 6; j++) {
      cube[i][0][j] = cube[i][p[0][j]][0];
      cube[i][1][j] = cube[i][p[1][j]][0];
      cube[i][2][j] = cube[i][p[2][j]][0];
    }
  }
  for (int i = 0; i < 1679616; i++) {
    for (int j = 0, tj = i; j < 8; j++, tj /= 6) {
      ti[j] = tj % 6;
    }
    dc[0] = dc[1] = dc[2] = 0;
    permOk = 1;
    checkedOrder = 0;
    for (int j = 0; j < 8 && permOk; j++) {
      int tj = ti[j];
      for (int k = j + 1; k < 8; k++) {
        int tk = ti[k];
        long long cx = cube[j][0][tj] - cube[k][0][tk],
                  cy = cube[j][1][tj] - cube[k][1][tk],
                  cz = cube[j][2][tj] - cube[k][2][tk];
        long long dist = (cx * cx + cy * cy + cz * cz);
        if (dc[0] == 0 || d[0] == dist) {
          d[0] = dist;
          dc[0]++;
        } else if (dc[1] == 0 || d[1] == dist) {
          d[1] = dist;
          dc[1]++;
        } else if (dc[2] == 0 || d[2] == dist) {
          d[2] = dist;
          dc[2]++;
        } else {
          permOk = 0;
          break;
        }
      }
      if (checkedOrder == 0 && permOk && dc[2] > 0) {
        if (d[0] > d[1]) {
          swap(d[0], d[1]);
          swap(dc[0], dc[1]);
        }
        if (d[0] > d[2]) {
          swap(d[0], d[2]);
          swap(dc[0], dc[2]);
        }
        if (d[1] > d[2]) {
          swap(d[1], d[2]);
          swap(dc[1], dc[2]);
        }
        if (d[0] < 1 || 2 * d[0] != d[1] || 3 * d[0] != d[2]) {
          permOk = 0;
        }
        checkedOrder = 1;
      }
    }
    if (permOk && dc[0] == 12 && dc[1] == 12 && dc[2] == 4) {
      cout << "YES\n";
      for (int j = 0; j < 8; j++) {
        int tj = ti[j];
        cout << cube[j][0][tj] << " " << cube[j][1][tj] << " " << cube[j][2][tj]
             << "\n";
      }
      return 0;
    }
  }
  cout << "NO\n";
  return 0;
}
