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;
const int INF = 1 << 29;
inline int two(int n) { return 1 << n; }
long long extgcd(long long a, long long b, long long& x, long long& y) {
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  } else {
    int g = extgcd(b, a % b, y, x);
    y -= a / b * x;
    return g;
  }
}
long long modpow(long long a, long long b) {
  long long res = 1;
  a %= 1000000007;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % 1000000007;
    a = a * a % 1000000007;
  }
  return res;
}
long long a[8][3];
long double d[8], pp[3];
map<long long, int> cnt;
long long b[8][3] = {{-13, -10, -6}, {-13, 2, -15}, {2, -10, -6},  {2, 2, -15},
                     {-13, -1, 6},   {2, -1, 6},    {-13, 11, -3}, {2, 11, -3}};
inline long long dist(int i, int j) {
  long long ans = 0;
  for (int k = 0; k < 3; k++) ans += (a[i][k] - a[j][k]) * (a[i][k] - a[j][k]);
  return ans;
}
bool foo(int i) {
  if (i == 8) {
    if (cnt.size() != 3) return false;
    auto x = cnt.begin();
    int ind = 0;
    while (ind < 3 && x != cnt.end()) {
      pp[ind] = x->first;
      x++;
      ind++;
    }
    return (pp[0] * 2 == pp[1] && pp[0] * 3 == pp[2] && cnt[pp[0]] == 12 &&
            cnt[pp[1]] == 12 && cnt[pp[2]] == 4);
  } else {
    do {
      for (int j = 0; j < i; j++) cnt[dist(i, j)]++;
      if (cnt.size() <= 3) {
        bool ans = foo(i + 1);
        if (ans) return true;
      }
      for (int j = 0; j < i; j++) {
        long long tt = dist(i, j);
        if (cnt[tt] == 1)
          cnt.erase(tt);
        else
          cnt[tt]--;
      }
    } while (next_permutation(a[i], a[i] + 3));
  }
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ifstream in("input.txt");
  ofstream out("output.txt");
  long long b;
  for (int i = 0; i < 8; i++) {
    for (int j = 0; j < 3; j++) cin >> a[i][j];
    sort(a[i], a[i] + 3);
  }
  bool res = foo(0);
  if (res) {
    cout << "YES" << endl;
    for (int i = 0; i < 8; i++) {
      for (int j = 0; j < 3; j++) cout << a[i][j] << " ";
      cout << endl;
    }
  } else
    cout << "NO" << endl;
  return 0;
}