#include <bits/stdc++.h>
using namespace std;
long long int arr[8][3];
int CU[8][3];
bool found = false;
double dis(int i, int j) {
  long long int x = ((arr[i][0] - arr[j][0]) * (arr[i][0] - arr[j][0]));
  long long int y = ((arr[i][1] - arr[j][1]) * (arr[i][1] - arr[j][1]));
  long long int z = ((arr[i][2] - arr[j][2]) * (arr[i][2] - arr[j][2]));
  long long int z2 = x + y + z;
  return sqrt(z2);
}
bool check() {
  int cnt = 0;
  double di, side = 1000000000;
  for (int i = 1; i < 8; ++i) {
    di = dis(0, i);
    if (side > di) {
      side = di;
      cnt = 1;
    } else if (side == di)
      ++cnt;
  }
  if (cnt != 3 || side == 0) return false;
  for (int i = 1; i < 8; ++i) {
    cnt = 0;
    for (int k = 0; k < 8; ++k) {
      if (i != k) {
        di = dis(i, k);
        if (side > di) {
          return false;
        } else if (side == di)
          ++cnt;
      }
    }
    if (cnt != 3) return false;
  }
  return true;
}
void bruteForce(int i) {
  if (i == 8) {
    if (check()) found = true;
    return;
  }
  int x = CU[i][0], y = CU[i][1], z = CU[i][2];
  if (!found) {
    arr[i][0] = x, arr[i][1] = y, arr[i][2] = z;
    bruteForce(i + 1);
    if (!found && z != y) {
      arr[i][0] = x, arr[i][1] = z, arr[i][2] = y;
      bruteForce(i + 1);
    }
    if (!found && x != y) {
      arr[i][0] = y, arr[i][1] = x, arr[i][2] = z;
      bruteForce(i + 1);
      if (!found && x != z) {
        arr[i][0] = y, arr[i][1] = z, arr[i][2] = x;
        bruteForce(i + 1);
      }
    }
    if (!found && x != z) {
      arr[i][0] = z, arr[i][1] = y, arr[i][2] = x;
      bruteForce(i + 1);
      if (!found && x != y) {
        arr[i][0] = z, arr[i][1] = x, arr[i][2] = y;
        bruteForce(i + 1);
      }
    }
  }
}
int main() {
  for (int i = 0; i < 8; ++i) cin >> CU[i][0] >> CU[i][1] >> CU[i][2];
  bruteForce(0);
  if (found) {
    cout << "YES" << endl;
    for (int i = 0; i < 8; ++i)
      cout << arr[i][0] << " " << arr[i][1] << " " << arr[i][2] << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
