#include <bits/stdc++.h>
using namespace std;
vector<int> pos[8];
vector<int> construct_vector(int a, int b, int c) {
  vector<int> ret;
  ret.push_back(a);
  ret.push_back(b);
  ret.push_back(c);
  return ret;
}
long long dist(vector<int> p1, vector<int> p2) {
  return (long long)(p1[0] - p2[0]) * (p1[0] - p2[0]) +
         (long long)(p1[1] - p2[1]) * (p1[1] - p2[1]) +
         (long long)(p1[2] - p2[2]) * (p1[2] - p2[2]);
}
map<long long, int> mpdist;
bool dfs(int k) {
  if (k == 8) return true;
  sort(pos[k].begin(), pos[k].end());
  do {
    bool f = true;
    for (int i = 0; f && i < k; ++i)
      if (pos[k] == pos[i]) f = false;
    if (!f) continue;
    for (int i = 0; i < k; ++i) ++mpdist[dist(pos[i], pos[k])];
    if (mpdist.size() <= 3u && dfs(k + 1)) return true;
    for (int i = 0; i < k; ++i) {
      long long dis = dist(pos[i], pos[k]);
      --mpdist[dis];
      if (!mpdist[dis]) mpdist.erase(dis);
    }
  } while (next_permutation(pos[k].begin(), pos[k].end()));
  return false;
}
int main() {
  for (int i = 0; i < 8; ++i) {
    int a, b, c;
    scanf("%d%d%d", &a, &b, &c);
    pos[i] = construct_vector(a, b, c);
  }
  if (dfs(0)) {
    printf("YES\n");
    for (int i = 0; i < 8; ++i)
      printf("%d %d %d\n", pos[i][0], pos[i][1], pos[i][2]);
  } else
    printf("NO");
  return 0;
}
