#include <bits/stdc++.h>
using namespace std;
const int INF = 0x7fffffff;
const int MINF = 0x80000000;
const long long mod = 1000000007;
const int cons = 100001;
vector<int> coodi[8];
int ans[8][3];
bool endj;
inline long long dist(int i, int j) {
  long long dx2 = (long long)(coodi[i][0] - coodi[j][0]) *
                  (long long)(coodi[i][0] - coodi[j][0]);
  long long dy2 = (long long)(coodi[i][1] - coodi[j][1]) *
                  (long long)(coodi[i][1] - coodi[j][1]);
  long long dz2 = (long long)(coodi[i][2] - coodi[j][2]) *
                  (long long)(coodi[i][2] - coodi[j][2]);
  return dx2 + dy2 + dz2;
}
bool judge() {
  for (int i = 0; i < 8; i++) {
    vector<long long> len;
    for (int j = 0; j < 8; j++) {
      if (j == i) continue;
      len.push_back(dist(i, j));
    }
    sort(len.begin(), len.end());
    if (len[0] == 0) return false;
    if (len[0] != len[2]) return false;
    if (len[0] * 2 != len[3]) return false;
    if (len[3] != len[5]) return false;
    if (len[0] * 3 != len[6]) return false;
  }
  return true;
}
void dfs(int n) {
  if (n == 8) {
    if (judge()) {
      puts("YES");
      for (int i = 0; i < 8; i++) {
        printf("%d %d %d\n", coodi[i][0], coodi[i][1], coodi[i][2]);
      }
      exit(0);
    }
    return;
  }
  sort(coodi[n].begin(), coodi[n].end());
  do {
    dfs(n + 1);
  } while (next_permutation(coodi[n].begin(), coodi[n].end()));
}
int main() {
  for (int i = 0; i < 8; i++) {
    coodi[i].resize(3);
    scanf("%d %d %d", &coodi[i][0], &coodi[i][1], &coodi[i][2]);
  }
  dfs(0);
  puts("NO");
  return 0;
}
