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);
	Tree t2 = new Tree(args[1],d);

	Vector triples = new Vector();
	Vector fans    = new Vector();

	t1.breakUp(triples,fans);
	t2.breakUp(triples,fans);

	Tree t3 = new Tree();
	Tree.OneTree(triples,fans,t3.getRoot(),d,t3);

	System.out.println(t3);

	/*

	for (int i=0;i<triples.size();i++)
	    System.out.println((Triple)triples.get(i));

	System.out.println("********************************");

	for (int i=0;i<fans.size();i++)
	    System.out.println((Triple)fans.get(i));

	*/
    }
}	    
