import choco.Problem;
import choco.Constraint;
import choco.Solver;
import choco.Solution;
import choco.ContradictionException;
import choco.integer.IntVar;
import choco.search.AssignVar;

import java.io.*;
import java.lang.*;
import java.util.*;

public class Build {	
   

    public static void main(String[] args) throws Exception,ContradictionException,FileNotFoundException,IOException {
	Dict d = new Dict();
	Tree t1 = new Tree(args[0],d);
	//t1.look();
	//System.out.println("**************************");
	Tree t2 = new Tree(args[1],d);
	//t2.look();
	//System.out.println("**************************");

	Problem pb = new Problem();
	int m = d.size();

	UMatrix um = new UMatrix(m,pb,d,false);	

	t1.breakUp(um);
	t2.breakUp(um);

	Solver sol = pb.getSolver();

	//sol.setVarSelector(new VarOrder(um.getDecisionVars()));

	pb.solve(false);

	//System.out.println(um);

	Tree t3 = um.toTree();
	System.out.println(t3);
	
	System.out.println(um);
	System.out.println(d);

	um.showTriples();
    }
}	    
