#include <bits/stdc++.h>
using namespace std;
const long double eps = 1e-9;
const int inf = (1 << 30) - 1;
const long long inf64 = ((long long)1 << 62) - 1;
const long double pi = acos(-1);
template <class T>
T sqr(T x) {
  return x * x;
}
template <class T>
T abs(T x) {
  return x < 0 ? -x : x;
}
int xyz[8][3], xyz1[8][3], xyz_cur[8][3];
int p[6][3], c[35][3];
int vxyz[3][3], vxyz_all[8][3];
long long smult_all[8][8];
long long smult(int a[3], int b[3]) {
  long long ans = 0;
  for (int i = 0; i < 3; ++i) {
    ans += ((long long)a[i]) * b[i];
  }
  return ans;
}
int main() {
  p[0][0] = 0;
  p[0][1] = 1;
  p[0][2] = 2;
  p[1][0] = 0;
  p[1][1] = 2;
  p[1][2] = 1;
  p[2][0] = 1;
  p[2][1] = 0;
  p[2][2] = 2;
  p[3][0] = 1;
  p[3][1] = 2;
  p[3][2] = 0;
  p[4][0] = 2;
  p[4][1] = 0;
  p[4][2] = 1;
  p[5][0] = 2;
  p[5][1] = 1;
  p[5][2] = 0;
  c[0][0] = 1;
  c[0][1] = 2;
  c[0][2] = 3;
  for (int i = 1; i < 35; ++i) {
    if (c[i - 1][2] < 7) {
      c[i][0] = c[i - 1][0];
      c[i][1] = c[i - 1][1];
      c[i][2] = c[i - 1][2] + 1;
    } else if (c[i - 1][1] < 6) {
      c[i][0] = c[i - 1][0];
      c[i][1] = c[i - 1][1] + 1;
      c[i][2] = c[i][1] + 1;
    } else {
      c[i][0] = c[i - 1][0] + 1;
      c[i][1] = c[i][0] + 1;
      c[i][2] = c[i][1] + 1;
    }
  }
  for (int i = 0; i < 8; ++i) {
    cin >> xyz[i][0] >> xyz[i][1] >> xyz[i][2];
  }
  int num_mask = 1;
  for (int i = 0; i < 7; ++i) {
    num_mask = num_mask * 6;
  }
  xyz1[0][0] = xyz[0][0];
  xyz1[0][1] = xyz[0][1];
  xyz1[0][2] = xyz[0][2];
  for (int mask = 0; mask < num_mask; ++mask) {
    int mask_cur = mask;
    for (int i = 1; i < 8; ++i) {
      int p_num = mask_cur % 6;
      for (int j = 0; j < 3; ++j) {
        xyz1[i][j] = xyz[i][p[p_num][j]];
      }
      mask_cur /= 6;
    }
    for (int i = 1; i < 8; ++i) {
      for (int j = 0; j < 3; ++j) {
        vxyz_all[i][j] = xyz1[i][j] - xyz1[0][j];
      }
    }
    for (int i = 1; i < 8; ++i) {
      for (int j = 1; j < 8; ++j) {
        smult_all[i][j] = smult(vxyz_all[i], vxyz_all[j]);
      }
    }
    for (int mask1 = 0; mask1 < 35; ++mask1) {
      if (smult_all[c[mask1][0]][c[mask1][0]] == 0) continue;
      if (smult_all[c[mask1][0]][c[mask1][1]] != 0 ||
          smult_all[c[mask1][0]][c[mask1][2]] != 0 ||
          smult_all[c[mask1][1]][c[mask1][2]] != 0)
        continue;
      if (smult_all[c[mask1][0]][c[mask1][0]] !=
              smult_all[c[mask1][1]][c[mask1][1]] ||
          smult_all[c[mask1][0]][c[mask1][0]] !=
              smult_all[c[mask1][2]][c[mask1][2]])
        continue;
      for (int i = 0; i < 3; ++i) {
        for (int j = 0; j < 3; ++j) {
          vxyz[i][j] = vxyz_all[c[mask1][i]][j];
        }
      }
      for (int i = 0; i < 8; ++i) {
        int take[3];
        int cur_i = i;
        for (int j = 0; j < 3; ++j) {
          take[j] = cur_i % 2;
          cur_i /= 2;
        }
        xyz_cur[i][0] = xyz[0][0];
        xyz_cur[i][1] = xyz[0][1];
        xyz_cur[i][2] = xyz[0][2];
        for (int j = 0; j < 3; ++j) {
          if (take[j] == 1) {
            xyz_cur[i][0] += vxyz[j][0];
            xyz_cur[i][1] += vxyz[j][1];
            xyz_cur[i][2] += vxyz[j][2];
          }
        }
      }
      bool total_key = true;
      for (int i = 3; i < 8; ++i) {
        if (i != 4) {
          bool key = false;
          for (int j = 1; j < 8; ++j) {
            if (xyz1[j][0] == xyz_cur[i][0] && xyz1[j][1] == xyz_cur[i][1] &&
                xyz1[j][2] == xyz_cur[i][2]) {
              key = true;
              break;
            }
          }
          if (!key) {
            total_key = false;
            break;
          }
        }
      }
      if (total_key) {
        cout << "YES" << endl;
        for (int i = 0; i < 8; ++i) {
          cout << xyz1[i][0] << " " << xyz1[i][1] << " " << xyz1[i][2] << endl;
        }
        return 0;
      }
    }
  }
  cout << "NO" << endl;
  return 0;
}
