}
    @SuppressWarnings({ "unchecked", "rawtypes" })
	public static void main(String args[]) throws IOException
    {
    	Comm.init(args);
    	world=Comm.world();
    	rank=world.rank();
    	size=world.size();
    	ObjectBuf<List<String>> gather;
    	Scanner scan;
    	Map<String,String> choices=new HashMap<String,String>();
    	Map<String,List<String>> attrs=new HashMap<String,List<String>>();
    	String decision = null;
    	List<Sample<String>> samples=new ArrayList<Sample<String>>();
    	File sample=new File("INPUT.txt");
    	List<String> type=new ArrayList<String>();
    	decisionbyvote=new ArrayList<String>();
    	results=new ArrayList<String>();
    	gather=ObjectBuf.buffer();
    	Sample test;
    	try {
			scan=new Scanner(sample);
			int number_of_attributes=scan.nextInt();
			String[] attributes=new String[number_of_attributes];
			
			for(int i=0;i<number_of_attributes;i++){
				attributes[i]=scan.next();
				}
			for(int i=0;i<number_of_attributes;i++){
				int num=scan.nextInt();
				for(int j=0;j<num;j++){
					type.add(scan.next());
				}
				
				attrs.put(attributes[i], type);
				//System.out.println(attrs);
				type=new ArrayList<String>();
			}
			while(scan.hasNext()){
				decision=scan.next();
				for(int i=0;i<number_of_attributes;i++){
				
					choices.put(attributes[i], scan.next());
				}
				//System.out.println(choices);
				//System.out.println(decision);
				samples.add(new Sample(choices,decision));
				choices=new HashMap<String,String>();
			}
			
		} catch (FileNotFoundException e) {
			System.err.print("File Not found");
		}
    	test=samples.get(1);
    	System.out.println(test.choices);
    	RandomForest forest=growRandomForest(attrs,samples,3,5,9);
    	for(int i=0;i<forest.trees.size();i++){
    		DecisionTree treeresult= (DecisionTree) forest.trees.get(i);
    		results.add((String) treeresult.decide(test.choices));
    		
    	}
    	System.out.println("Decision by "+rank+" which is "+results);
    	if(rank!=0){
    		gather.fill(results);
    		world.send(0, gather);
    	}
    	else{
    		decisionbyvote.addAll(results);
    		for(int i=1;i<size;i++){
    			world.receive(i, gather);
    			decisionbyvote.addAll(gather.get(0));
    		}
    		System.out.println(decisionbyvote);
    		System.out.println(ListUtils.mode(decisionbyvote));
    	}