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>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
const int inf = 1000000007;
const long long linf = 1000000000000000000LL;
const unsigned long long ulinf = (1ULL << 63) - 10ULL;
const double eps = 0.000001;
const double pi = 3.14159265358979323846;
template <class T>
T abs(T a) {
  return a >= 0 ? a : -a;
}
template <class T>
T sqr(T a) {
  return a * a;
}
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <class T>
T mod(T a, T b) {
  return (a % b + b) % b;
}
template <class T>
T lowbit(T x) {
  return x & -x;
}
long long addmod(long long a, long long b, long long c) {
  return ((a + b) % c + c) % c;
}
long long mulmod(long long a, long long b, long long c) {
  if (b == 0LL) return 0LL;
  long long ret = mulmod(a, b >> 1, c);
  ret = (ret + ret) % c;
  if (b & 1LL) ret = (ret + a) % c;
  return ret;
}
long long powmod(long long a, long long b, long long c) {
  if (b == 0LL) return 1LL;
  long long ret = powmod(a, b >> 1, c);
  ret = ret * ret % c;
  if (b & 1LL) ret = ret * a % c;
  return ret;
}
long long modinv(long long a, long long b) { return powmod(a, b - 2LL, b); }
template <class T>
void maxe(T &a, T b) {
  if (a < b) a = b;
}
template <class T>
void mine(T &a, T b) {
  if (a > b) a = b;
}
int iszero(double a) { return abs(a) <= eps; }
template <class T>
void geti(T &a) {
  a = 0;
  T b = 1;
  char c = getchar();
  if (c == '-')
    b = -1;
  else
    a = c - 48;
  while ((c = getchar()) != ' ' && c != '\n') a = a * 10 + c - 48;
  a *= b;
}
void fileio_in_out() {
  freopen(".in", "r", stdin);
  freopen(".out", "w", stdout);
}
void fileio_txt() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
const int N = 1010;
const int M = 27;
const int K = 33;
const long long md = inf;
int test;
int n, m, k, ans;
int a[8][3], b[8][3];
const int perm[6][3] = {{0, 1, 2}, {0, 2, 1}, {1, 0, 2},
                        {1, 2, 0}, {2, 0, 1}, {2, 1, 0}};
map<long long, int> cnt;
const int tcnt[] = {12, 12, 4};
long long dist(int x, int y) {
  long long ret = 0;
  for (int i = 0; i < 3; i++)
    ret += 1LL * (b[x][i] - b[y][i]) * (b[x][i] - b[y][i]);
  return ret;
}
int check() {
  cnt.clear();
  for (int i = 0; i < 8; i++)
    for (int j = i + 1; j < 8; j++) {
      cnt[dist(i, j)]++;
      if (cnt.size() > 3) return 0;
    }
  if (cnt.size() != 3) return 0;
  int i = 0;
  long long l = 0;
  for (map<long long, int>::iterator it = cnt.begin(); it != cnt.end(); it++) {
    int c = (*it).second;
    if (c != tcnt[i++]) return 0;
    long long len = (*it).first;
    if (l) {
      if (len != l * i) return 0;
    } else
      l = len;
  }
  return 1;
}
int dfs(int t) {
  if (t == 8) return check();
  for (int i = 0; i < 6; i++) {
    for (int j = 0; j < 3; j++) b[t][j] = a[t][perm[i][j]];
    int res = dfs(t + 1);
    if (res) return 1;
  }
  return 0;
}
int main() {
  for (int i = 0; i < 8; i++)
    for (int j = 0; j < 3; j++) scanf("%d", &a[i][j]);
  for (int i = 0; i < 3; i++) b[0][i] = a[0][i];
  ans = dfs(1);
  if (ans) {
    puts("YES");
    for (int i = 0; i < 8; i++) printf("%d %d %d\n", b[i][0], b[i][1], b[i][2]);
  } else
    puts("NO");
  return 0;
}