#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
struct pt {
  long long int x, y, z;
  pt() {}
  pt(long long int x, long long int y, long long int z) : x(x), y(y), z(z) {}
  bool operator<(const pt other) const {
    if (x == other.x && y == other.y) return z < other.z;
    if (x == other.x) return y < other.y;
    return z < other.z;
  }
};
void print(pt a) { cout << a.x << " " << a.y << " " << a.z << '\n'; }
void read(pt &a) { cin >> a.x >> a.y >> a.z; }
long long int dist(pt a, pt b) {
  return (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y) +
         (a.z - b.z) * (a.z - b.z);
}
vector<pt> p(8);
long long int V[29], cnt;
bool checkcube() {
  cnt = 0;
  for (int i = 0; i < 8; ++i)
    for (int j = i + 1; j < 8; ++j) V[cnt++] = dist(p[i], p[j]);
  sort(V, V + 28);
  if (!V[0]) return false;
  for (int i = 1; i <= 11; ++i)
    if (V[0] != V[i]) return false;
  for (int i = 13; i <= 23; ++i)
    if (V[12] != V[i]) return false;
  for (int i = 25; i <= 27; ++i)
    if (V[24] != V[i]) return false;
  return true;
}
void bk(int idx) {
  if (idx == 8) {
    if (checkcube()) {
      cout << "YES" << '\n';
      for (auto i : p) print(i);
      exit(0);
    }
    return;
  }
  long long int v[] = {p[idx].x, p[idx].y, p[idx].z};
  sort(v, v + 3);
  do {
    p[idx] = pt(v[0], v[1], v[2]);
    bk(idx + 1);
  } while (next_permutation(v, v + 3));
}
int main() {
  cin.sync_with_stdio(0), cin.tie(0);
  ;
  59;
  for (int i = 0; i < 8; ++i) read(p[i]);
  bk(1);
  cout << "NO\n";
  return 0;
}
