#include <bits/stdc++.h>
using namespace std;
int input[8][3];
int point[8][3];
inline long long dist(pair<int, pair<int, int> > a) {
  return (long long)a.first * a.first +
         (long long)a.second.first * a.second.first +
         (long long)a.second.second * a.second.second;
}
inline bool perpendicular(pair<int, pair<int, int> > a,
                          pair<int, pair<int, int> > b) {
  return !((long long)a.first * b.first +
           (long long)a.second.first * b.second.first +
           (long long)a.second.second * b.second.second);
}
inline bool cmp(pair<int, pair<int, int> > a, pair<int, pair<int, int> > b) {
  return dist(a) < dist(b);
}
bool iscube() {
  pair<int, pair<int, int> > calcpoint[8];
  for (int i = 0; i < 8; i++) {
    calcpoint[i].first = point[i][0] - point[0][0];
    calcpoint[i].second.first = point[i][1] - point[0][1];
    calcpoint[i].second.second = point[i][2] - point[0][2];
  }
  sort(calcpoint, calcpoint + 8, cmp);
  if (dist(calcpoint[1]) == 0) return false;
  if (dist(calcpoint[1]) != dist(calcpoint[2])) return false;
  if (dist(calcpoint[2]) != dist(calcpoint[3])) return false;
  if (dist(calcpoint[3]) != dist(calcpoint[1])) return false;
  if (!perpendicular(calcpoint[1], calcpoint[2])) return false;
  if (!perpendicular(calcpoint[2], calcpoint[3])) return false;
  if (!perpendicular(calcpoint[3], calcpoint[1])) return false;
  pair<int, pair<int, int> > p12, p23, p31, p123;
  p12.first = calcpoint[1].first + calcpoint[2].first;
  p12.second.first = calcpoint[1].second.first + calcpoint[2].second.first;
  p12.second.second = calcpoint[1].second.second + calcpoint[2].second.second;
  p23.first = calcpoint[2].first + calcpoint[3].first;
  p23.second.first = calcpoint[2].second.first + calcpoint[3].second.first;
  p23.second.second = calcpoint[2].second.second + calcpoint[3].second.second;
  p31.first = calcpoint[3].first + calcpoint[1].first;
  p31.second.first = calcpoint[3].second.first + calcpoint[1].second.first;
  p31.second.second = calcpoint[3].second.second + calcpoint[1].second.second;
  p123.first = calcpoint[1].first + calcpoint[2].first + calcpoint[3].first;
  p123.second.first = calcpoint[1].second.first + calcpoint[2].second.first +
                      calcpoint[3].second.first;
  p123.second.second = calcpoint[1].second.second + calcpoint[2].second.second +
                       calcpoint[3].second.second;
  if (p123 != calcpoint[7]) return false;
  if (p12 != calcpoint[4] && p12 != calcpoint[5] && p12 != calcpoint[6])
    return false;
  if (p23 != calcpoint[4] && p23 != calcpoint[5] && p23 != calcpoint[6])
    return false;
  if (p31 != calcpoint[4] && p31 != calcpoint[5] && p31 != calcpoint[6])
    return false;
  return true;
}
void bktk(int n) {
  if (n == 8) {
    if (iscube()) {
      printf("YES");
      for (int i = 0; i < 8; i++)
        printf("\n%d %d %d", point[i][0], point[i][1], point[i][2]);
      exit(0);
    }
    return;
  }
  point[n][0] = input[n][0];
  point[n][1] = input[n][1];
  point[n][2] = input[n][2];
  bktk(n + 1);
  point[n][0] = input[n][0];
  point[n][1] = input[n][2];
  point[n][2] = input[n][1];
  bktk(n + 1);
  point[n][0] = input[n][1];
  point[n][1] = input[n][0];
  point[n][2] = input[n][2];
  bktk(n + 1);
  point[n][0] = input[n][1];
  point[n][1] = input[n][2];
  point[n][2] = input[n][0];
  bktk(n + 1);
  point[n][0] = input[n][2];
  point[n][1] = input[n][0];
  point[n][2] = input[n][1];
  bktk(n + 1);
  point[n][0] = input[n][2];
  point[n][1] = input[n][1];
  point[n][2] = input[n][0];
  bktk(n + 1);
}
int main() {
  for (int i = 0; i < 8; i++)
    for (int j = 0; j < 3; j++) scanf("%d", &input[i][j]);
  point[0][0] = input[0][0];
  point[0][1] = input[0][1];
  point[0][2] = input[0][2];
  bktk(1);
  printf("NO");
}
