Problem: Peter had a cube with non-zero length of a side. He put the cube into three-dimensional space in such a way that its vertices lay at integer points (it is possible that the cube's sides are not parallel to the coordinate axes). Then he took a piece of paper and wrote down eight lines, each containing three integers — coordinates of cube's vertex (a single line contains coordinates of a single vertex, each vertex is written exactly once), put the paper on the table and left. While Peter was away, his little brother Nick decided to play with the numbers on the paper. In one operation Nick could swap some numbers inside a single line (Nick didn't swap numbers from distinct lines). Nick could have performed any number of such operations.

When Peter returned and found out about Nick's mischief, he started recollecting the original coordinates. Help Peter restore the original position of the points or else state that this is impossible and the numbers were initially recorded incorrectly.

Input

Each of the eight lines contains three space-separated integers — the numbers written on the piece of paper after Nick's mischief. All numbers do not exceed 106 in their absolute value.

Output

If there is a way to restore the cube, then print in the first line "YES". In each of the next eight lines print three integers — the restored coordinates of the points. The numbers in the i-th output line must be a permutation of the numbers in i-th input line. The numbers should represent the vertices of a cube with non-zero length of a side. If there are multiple possible ways, print any of them.

If there is no valid way, print "NO" (without the quotes) in the first line. Do not print anything else.

Examples

Input

0 0 0
0 0 1
0 0 1
0 0 1
0 1 1
0 1 1
0 1 1
1 1 1


Output

YES
0 0 0
0 0 1
0 1 0
1 0 0
0 1 1
1 0 1
1 1 0
1 1 1


Input

0 0 0
0 0 0
0 0 0
0 0 0
1 1 1
1 1 1
1 1 1
1 1 1


Output

NO

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
vector<long long> operator+(vector<long long> a, vector<long long> b) {
  for (int i = (int)(0); i < (int)(3); ++i) a[i] += b[i];
  return a;
}
vector<long long> operator-(vector<long long> a, vector<long long> b) {
  for (int i = (int)(0); i < (int)(3); ++i) a[i] -= b[i];
  return a;
}
void operator+=(vector<long long> &a, vector<long long> b) { a = a + b; }
void operator-=(vector<long long> &a, vector<long long> b) { a = a - b; }
multiset<multiset<long long> > MS;
long long d(vector<long long> a) {
  return a[0] * a[0] + a[1] * a[1] + a[2] * a[2];
}
bool good(vector<long long> a, vector<long long> b) {
  if (!d(a)) return false;
  if (d(a) != d(b)) return false;
  if (d(a - b) != 2 * d(a)) return false;
  return true;
}
multiset<long long> f(vector<long long> v) {
  multiset<long long> t;
  for (auto x : v) t.insert(x);
  return t;
}
void display(vector<long long> v) {
  for (auto x : v) printf("%I64d ", x);
  printf("\n");
}
vector<multiset<long long> > VS;
void att(vector<long long> v, vector<long long> va, vector<long long> vb,
         vector<long long> vc) {
  va -= v, vb -= v, vc -= v;
  if (!good(va, vb) || !good(va, vc) || !good(vc, vb)) return;
  if (d(va + vb + vc) != 3 * d(va)) return;
  static multiset<multiset<long long> > MS2;
  MS2.clear();
  MS2.insert(f(v));
  MS2.insert(f(v + va));
  MS2.insert(f(v + vb));
  MS2.insert(f(v + vc));
  MS2.insert(f(v + va + vb));
  MS2.insert(f(v + va + vc));
  MS2.insert(f(v + vb + vc));
  MS2.insert(f(v + va + vb + vc));
  if (MS2 != MS) return;
  printf("YES\n");
  vector<vector<long long> > VV;
  VV.push_back(v);
  VV.push_back(v + va);
  VV.push_back(v + vb);
  VV.push_back(v + vc);
  VV.push_back(v + va + vb);
  VV.push_back(v + va + vc);
  VV.push_back(v + vb + vc);
  VV.push_back(v + va + vb + vc);
  for (auto x : VS)
    for (int i = (int)(0); i < (int)(VV.size()); ++i) {
      if (x != f(VV[i])) continue;
      display(VV[i]);
      VV.erase(VV.begin() + i);
      break;
    }
  exit(0);
}
void att(vector<long long> v, vector<long long> va, vector<long long> vb) {
  for (auto x : MS) {
    vector<long long> v2;
    for (auto y : x) v2.push_back(y);
    for (int ttt = (int)(0); ttt < (int)(6); ++ttt) {
      att(v, va, vb, v2);
      if (ttt & 1)
        swap(v2[0], v2[1]);
      else
        swap(v2[1], v2[2]);
    }
  }
}
void att(vector<long long> v, vector<long long> va) {
  for (auto x : MS) {
    vector<long long> v2;
    for (auto y : x) v2.push_back(y);
    for (int ttt = (int)(0); ttt < (int)(6); ++ttt) {
      att(v, va, v2);
      if (ttt & 1)
        swap(v2[0], v2[1]);
      else
        swap(v2[1], v2[2]);
    }
  }
}
int main() {
  for (int i = (int)(0); i < (int)(8); ++i) {
    multiset<long long> t;
    for (int j = (int)(0); j < (int)(3); ++j) {
      long long x;
      scanf("%I64d", &x);
      t.insert(x);
    }
    MS.insert(t);
    VS.push_back(t);
  }
  multiset<long long> m1 = *MS.begin();
  vector<long long> v1;
  for (auto x : m1) v1.push_back(x);
  for (auto x : MS) {
    vector<long long> v2;
    for (auto y : x) v2.push_back(y);
    for (int ttt = (int)(0); ttt < (int)(6); ++ttt) {
      att(v1, v2);
      if (ttt & 1)
        swap(v2[0], v2[1]);
      else
        swap(v2[1], v2[2]);
    }
  }
  printf("NO\n");
  return 0;
}