#include <bits/stdc++.h>
using namespace std;
int cases;
bool flag;
vector<int> cube[8];
vector<long long> tmp;
inline long long _distance(long long x, long long y, long long z) {
  return x * x + y * y + z * z;
}
bool check() {
  tmp.clear();
  for (int i = 0; i < 7; i++) {
    for (int j = i + 1; j < 8; j++) {
      long long dis =
          _distance(cube[j][0] - cube[i][0], cube[j][1] - cube[i][1],
                    cube[j][2] - cube[i][2]);
      tmp.push_back(dis);
    }
  }
  sort(tmp.begin(), tmp.end());
  if (tmp.size() != 28) return false;
  if (tmp[0] == tmp[12] || tmp[0] == tmp[27] || tmp[12] == tmp[27])
    return false;
  if (tmp[0] != tmp[11] || tmp[12] != tmp[23] || tmp[24] != tmp[27])
    return false;
  if (tmp[0] * 2 != tmp[23] || tmp[0] * 3 != tmp[27]) return false;
  return true;
}
void dfs(int h) {
  if (h == 7) {
    if (check()) {
      flag = 1;
    }
    return;
  }
  sort(cube[h].begin(), cube[h].end());
  do {
    dfs(h + 1);
    if (flag) return;
  } while (next_permutation(cube[h].begin(), cube[h].end()));
}
void print() {
  for (int i = 0; i < 8; i++) {
    for (int j = 0; j < 3; j++) {
      printf("%d ", cube[i][j]);
    }
    putchar('\n');
  }
}
int main() {
  int x;
  for (int i = 0; i < 8; i++) {
    for (int j = 0; j < 3; j++) {
      scanf("%d", &x);
      cube[i].push_back(x);
    }
  }
  dfs(0);
  if (flag) {
    puts("YES");
    print();
  } else {
    puts("NO");
  }
}
