#include <bits/stdc++.h>
using namespace std;
const long long inf = 12345678;
class vec {
  long long x, y, z;

 public:
  long long get_x() { return x; }
  long long get_y() { return y; }
  long long get_z() { return z; }
  vec() { x = y = z = 0; }
  vec(long long _x, long long _y, long long _z) {
    x = _x;
    y = _y;
    z = _z;
  }
  vec operator+(vec other) {
    return vec((x + other.x), (y + other.y), (z + other.z));
  }
  vec operator-(vec other) {
    return vec((x - other.x), (y - other.y), (z - other.z));
  }
  long long operator&(vec other) {
    return (x * (other.x) + y * (other.y) + z * (other.z));
  }
  vec operator*(vec other) {
    return vec(y * other.z - z * other.y, z * other.x - x * other.z,
               x * other.y - y * other.z);
  }
  bool operator==(vec other) {
    vec v = *this - other;
    return (v.d2() == 0);
  }
  bool operator||(vec other) {
    vec v = *this * other;
    return (v.d2() == 0);
  }
  long long d2() { return (x * x + y * y + z * z); }
};
bool mind2(vec a, vec b) { return a.d2() < b.d2(); }
bool is_cube(vector<vec> v) {
  vector<vec> seg(8);
  for (int i = 0; i < 8; ++i) {
    seg[i] = (v[i] - v[0]);
  }
  sort(seg.begin(), seg.end(), mind2);
  if (!seg[2].d2()) return false;
  if (!(seg[1].d2() == seg[2].d2() && seg[2].d2() == seg[3].d2())) return false;
  if (!(((seg[1] & seg[2]) == 0) && ((seg[1] & seg[3]) == 0) &&
        ((seg[2] & seg[1]) == 0)))
    return false;
  if (!((seg[1] & seg[2]) == 0)) return false;
  if (!(seg[4].d2() == seg[5].d2() && seg[5].d2() == seg[6].d2())) return false;
  if (!((((seg[7] - seg[6]) & (seg[7] - seg[5])) == 0) &&
        (((seg[7] - seg[6]) & (seg[7] - seg[4])) == 0) &&
        (((seg[7] - seg[5]) & (seg[7] - seg[4])) == 0)))
    return false;
  if (!(seg[7] == (seg[1] + seg[2] + seg[3]))) return false;
  return true;
}
long long arr[8][3];
int main() {
  cin.tie(NULL);
  ios_base ::sync_with_stdio(false);
  for (int i = 0; i < 8; ++i) {
    for (int j = 0; j < 3; ++j) {
      cin >> arr[i][j];
    }
    sort(arr[i], arr[i] + 3);
  }
  do {
    do {
      do {
        do {
          do {
            do {
              do {
                vector<vec> figure(8);
                for (int i = 0; i < 8; ++i) {
                  figure[i] = vec(arr[i][0], arr[i][1], arr[i][2]);
                }
                if (is_cube(figure)) {
                  cout << "YES\n";
                  for (int i = 0; i < 8; ++i) {
                    for (int j = 0; j < 3; ++j) {
                      cout << arr[i][j] << " ";
                    }
                    cout << "\n";
                  }
                  return 0;
                }
              } while (next_permutation(arr[7], arr[7] + 3));
            } while (next_permutation(arr[6], arr[6] + 3));
          } while (next_permutation(arr[5], arr[5] + 3));
        } while (next_permutation(arr[4], arr[4] + 3));
      } while (next_permutation(arr[3], arr[3] + 3));
    } while (next_permutation(arr[2], arr[2] + 3));
  } while (next_permutation(arr[1], arr[1] + 3));
  cout << "NO";
  return 0;
}
