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 JAVA):

Solution:
import java.io.*;
import java.util.*;
import static java.lang.Math.*;
import java.math.BigInteger;
import static java.math.BigInteger.*;
import static java.util.Arrays.*;
import javax.xml.ws.Holder;



//<editor-fold defaultstate="collapsed" desc="Main">
public class Task{
// https://netbeans.org/kb/73/java/editor-codereference_ru.html#display
    private void run() {
        try {
            Locale.setDefault(Locale.US);
        } catch (Exception e) {
        }
        boolean oj = true;
        try {
            oj = System.getProperty("MYLOCAL") == null;
        } catch (Exception e) {
        }

        if (oj) {
            sc = new FastScanner(new InputStreamReader(System.in));
            out = new PrintWriter(new OutputStreamWriter(System.out));
        } else {
            try {
                sc = new FastScanner(new FileReader("input.txt"));
                out = new PrintWriter(new FileWriter("output.txt"));
            } catch (IOException e) {
                MLE();
            }
        }
        Solver s = new Solver();
        s.sc = sc;
        s.out = out;
        s.solve();
        if (!oj) {
            err.println("Time: " + (System.currentTimeMillis() - timeBegin) / 1e3);
            err.printf("Mem: %d\n", (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) >> 20);
        }
        out.flush();
    }

    private void show(int[] arr) {
        for (int v : arr) {
            err.print(" " + v);
        }
        err.println();
    }

    public static void exit() {
        err.println("Time: " + (System.currentTimeMillis() - timeBegin) / 1e3);
        out.flush();
        out.close();
        System.exit(0);
    }

    public static void MLE() {
        int[][] arr = new int[1024 * 1024][];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = new int[1024 * 1024];
        }
    }

    public static void main(String[] args) {
        new Task().run();
    }

    static long timeBegin = System.currentTimeMillis();
    static FastScanner sc;
    static PrintWriter out;
    static PrintStream err = System.err;
}
//</editor-fold>

//<editor-fold defaultstate="collapsed" desc="FastScanner">
class FastScanner {

    BufferedReader br;
    StringTokenizer st;

    FastScanner(InputStreamReader reader) {
        br = new BufferedReader(reader);
        st = new StringTokenizer("");
    }

    String next() {
        while (!st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException ex) {
                Task.MLE();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    long nextLong() {
        return Long.parseLong(next());
    }
    double nextDouble() {
        return Double.parseDouble(next());
    }
}
//</editor-fold>

class Solver {
    void ass(boolean OK) { if(!OK)Task.MLE(); }

    FastScanner sc;
    PrintWriter out;
    static PrintStream err = System.err;

    int[][] ord = { {0,1,2}, {0,2,1},  {1,0,2}, {1,2,0}, {2,0,1}, {2,1,0} };
    long[][] x, ans;
    long[] dist;

    boolean OK(){
        int cnt = 0;
        dist = new long[8*7/2];
        for (int i = 0; i < 8; i++)
            for (int j = i+1; j < 8; j++)
                dist[cnt++] = sq(ans[i],ans[j]);
        sort( dist );
        if( dist[0] == 0 ) return false;
        boolean OK = true;
        for( int i =  0; i < 12; ++i ) OK &= (  dist[0]==dist[i]);
        for( int i = 12; i < 24; ++i ) OK &= (2*dist[0]==dist[i]);
        for( int i = 24; i < 28; ++i ) OK &= (3*dist[0]==dist[i]);
        return OK;
    }
    
    long sq( long x ){ return x*x; }
    
    long sq( long[] a, long[] b ){
        long d = 0;
        for (int i = 0; i < 3; i++) d += sq( a[i] - b[i] );
        return d;
    }
    
    boolean dfs( int isPoint ){
        if( isPoint == 8 ){
            return OK();
        }
        else{
            for (int[] p : ord) {
                for (int i = 0; i < 3; i++)
                    ans[isPoint][i] = x[isPoint][p[i]];
                if( dfs( isPoint + 1 ) ) return true;
            }
            return false;
        }
    }
    
    
    void solve(){
        x = new long[8][3];
        for (int i = 0; i < 8; i++)
            for (int j = 0; j < 3; j++)
                x[i][j] = sc.nextLong();
        
        ans = new long[8][3];
        ans[0] = x[0];
        if( dfs(1) ){
            out.println( "YES" );
            for( long[] ansi : ans ){
                for( long ansij : ansi ) out.print( " " + ansij );
                out.println();
            }
        }
        else
            out.println("NO");
    }
}