#include <bits/stdc++.h>
using namespace std;
string i_s(int x) {
  if (x == 0) return "0";
  string ret = "";
  while (x) {
    ret = ret + (char)(x % 10 + '0');
    x /= 10;
  }
  reverse(ret.begin(), ret.end());
  return ret;
}
string add(string a, string b) {
  if (a == "") a = "0";
  if (b == "") b = "0";
  if (a.length() < b.length()) swap(a, b);
  while (b.length() < a.length()) {
    b = '0' + b;
  }
  for (int i = 0; i < a.length(); i++) {
    a[i] = a[i] + (b[i] - '0');
  }
  bool big = false;
  for (int i = a.length() - 1; i >= 0; i--) {
    if (big) {
      a[i]++;
    }
    big = false;
    if (a[i] > '9') {
      a[i] = a[i] - 10;
      big = true;
    }
  }
  if (big) a = '1' + a;
  return a;
}
string mul(string a, string b) {
  vector<int> va, vb;
  if (a == "0" || b == "0") return "0";
  string ans;
  for (int i = 0; i < a.length(); i++) {
    va.push_back(a[i] - '0');
  }
  for (int i = 0; i < b.length(); i++) {
    vb.push_back(b[i] - '0');
  }
  reverse(va.begin(), va.end());
  reverse(vb.begin(), vb.end());
  vector<int> res;
  res.clear();
  res.resize(1005);
  for (int i = 0; i < a.length(); i++) {
    for (int j = 0; j < b.length(); j++) {
      res[i + j] += (va[i] * vb[j]);
    }
  }
  for (int i = 0; i < 1005; i++) {
    if (res[i] > 9) {
      res[i + 1] += (res[i] / 10);
      res[i] %= 10;
    }
  }
  for (int i = 0; i < 1005; i++) {
    ans += (res[i] + '0');
  }
  reverse(ans.begin(), ans.end());
  int k = 0;
  while (ans[k] == '0') {
    k++;
  }
  ans = ans.substr(k);
  return ans;
}
bool is_prime(int n) {
  if (n < 2) return false;
  for (int i = 2; i * i <= n; i++)
    if (n % i == 0) return false;
  return true;
}
const int N = 10;
long long p[N][3];
long long dis(long long x, long long y, long long z) {
  return x * x + y * y + z * z;
}
bool ok(int m) {
  long long a[N];
  int cnt = -1;
  for (int i = 0; i < 8; ++i)
    if (i != m)
      a[++cnt] = dis(p[m][0] - p[i][0], p[m][1] - p[i][1], p[m][2] - p[i][2]);
  sort(a, a + 7);
  if (a[0] == 0 || a[0] != a[1] || a[0] != a[2] || a[3] != a[4] ||
      a[3] != a[5] || a[0] * 2 != a[3] || a[0] * 3 != a[6])
    return false;
  return true;
}
bool check() {
  for (int i = 0; i < 8; ++i)
    if (!ok(i)) return false;
  puts("YES");
  for (int i = 0; i < 8; ++i) {
    for (int j = 0; j < 3; ++j) printf("%I64d ", p[i][j]);
    puts("");
  }
  return true;
}
bool dfs(int m) {
  if (m == 8) return check();
  sort(p[m], p[m] + 3);
  do {
    if (dfs(m + 1)) return true;
  } while (next_permutation(p[m], p[m] + 3));
  return false;
}
int main() {
  for (int i = 0; i < 8; ++i)
    for (int j = 0; j < 3; ++j) scanf("%I64d", &p[i][j]);
  if (!dfs(0)) puts("NO");
  return 0;
}
