#include <bits/stdc++.h>
using namespace std;
const int maxn = 100;
vector<vector<long long> > v[maxn];
vector<long long> a, u, cur[maxn];
int now[maxn], n = 8, cnt[maxn];
long long val(long long x) {
  if (x > 0) return x;
  return -x;
}
long long fas(long long x1, long long y1, long long z1, long long x2,
              long long y2, long long z2) {
  long long q = val(x1 - x2);
  long long w = val(y1 - y2);
  long long e = val(z1 - z2);
  q = q * q, w = w * w, e = e * e;
  return q + w + e;
}
bool check() {
  for (int i = 0; i < n; i++) cur[i] = v[i][now[i]];
  long long minn = 1e17;
  for (int i = 0; i < n; i++) {
    long long x1 = cur[i][0], y1 = cur[i][1], z1 = cur[i][2];
    for (int j = i + 1; j < n; j++) {
      long long x2 = cur[j][0], y2 = cur[j][1], z2 = cur[j][2];
      minn = min(minn, (fas(x1, y1, z1, x2, y2, z2)));
    }
  }
  cnt[1] = 0, cnt[2] = 0, cnt[3] = 0;
  for (int i = 0; i < n; i++) {
    long long x1 = cur[i][0], y1 = cur[i][1], z1 = cur[i][2];
    for (int j = i + 1; j < n; j++) {
      long long x2 = cur[j][0], y2 = cur[j][1], z2 = cur[j][2];
      long long cur = (fas(x1, y1, z1, x2, y2, z2));
      if (cur != minn && cur != 2 * minn && cur != 3 * minn)
        return false;
      else if (cur == 2 * minn)
        cnt[2]++;
      else if (cur == minn)
        cnt[1]++;
      else
        cnt[3]++;
    }
  }
  if (cnt[1] == 12 && cnt[2] == 12 && cnt[3] == 4) return true;
  return false;
}
void go_next() {
  for (int i = n - 1; i >= 0; i--) {
    int kol = v[i].size() - 1;
    if (kol != now[i]) {
      now[i]++;
      for (int j = i + 1; j < n; j++) now[j] = 0;
      return;
    }
  }
}
int main() {
  for (int i = 0; i < n; i++) {
    long long x, y, z;
    cin >> x >> y >> z;
    a.clear();
    a.push_back(x), a.push_back(y), a.push_back(z);
    sort(a.begin(), a.end());
    v[i].push_back(a);
    while (next_permutation(a.begin(), a.end())) {
      v[i].push_back(a);
    }
  }
  int tot = 1;
  for (int i = 0; i < n; i++) tot *= v[i].size();
  for (int i = 0; i < n; i++) now[i] = 0;
  for (int i = 0; i < tot + 5; i++) {
    bool res = check();
    if (res) {
      cout << "YES"
           << "\n";
      for (int i = 0; i < n; i++) {
        for (int j = 0; j < v[i][now[i]].size(); j++)
          cout << v[i][now[i]][j] << " ";
        cout << "\n";
      }
      return 0;
    }
    go_next();
  }
  cout << "NO" << endl;
  return 0;
}
