#include <bits/stdc++.h>
using namespace std;
long long A[8][3];
long long sqr(long long x) { return x * x; }
long long dist(int x, int y) {
  long long res = 0;
  for (int i = 0; i < 3; i++) {
    res += sqr(A[x][i] - A[y][i]);
  }
  return res;
}
int need[4] = {0, 12, 12, 4};
vector<long long> v;
bool eval() {
  long long mn = *min_element((v).begin(), (v).end());
  if (mn == 0) {
    return false;
  }
  int a[4] = {0, 0, 0, 0};
  for (long long x : v) {
    if (x % mn) {
      return false;
    }
    x /= mn;
    if (1 <= x && x <= 3) {
      if (++a[x] > need[x]) {
        return false;
      }
    } else {
      return false;
    }
  }
  return true;
}
void go(int x) {
  if (x == 8) {
    if (eval()) {
      puts("YES");
      for (int i = 0; i < 8; i++) {
        for (int j = 0; j < 3; j++) {
          printf("%lld ", A[i][j]);
        }
        puts("");
      }
      exit(0);
    }
    return;
  }
  do {
    for (int i = 0; i < x; i++) {
      v.push_back(dist(i, x));
    }
    go(x + 1);
    v.erase(v.end() - x, v.end());
  } while (next_permutation(A[x], A[x] + 3));
}
int main() {
  if (fopen("input.txt", "r")) {
    freopen("input.txt", "r", stdin);
  }
  for (int i = 0; i < 8; i++) {
    for (int j = 0; j < 3; j++) {
      scanf("%lld", &A[i][j]);
    }
    sort(A[i], A[i] + 3);
  }
  go(0);
  puts("NO");
}
