import java.util.*;
class GenericTree {
private class Node{
int data;
ArrayList childeren;
Node(int data){
this.data=data;
this.childeren=new ArrayList();
}
}
private Node root;
private int size;
GenericTree(){
Scanner sc=new Scanner(System.in);
this.root=takeInput(sc,null,0);
}
//to take input of generic tree
private Node takeInput(Scanner sc, Node parent, int ithchild) {
if(parent==null) {
System.out.println("Enter the data for the root node ");
// root.data=sc.nextInt();
}
else {
System.out.println("Enter the data for the "+ithchild+" th child of"+parent.data);
}
int nodedata=sc.nextInt();
Node node=new Node(nodedata);
this.size++;
System.out.println("Enter the number of childeren for "+node.data);
int childn=sc.nextInt();
//will be executed according to the value of children
for(int i=0;i<childn;i++) {
Node child=this.takeInput(sc,node,i);
node.childeren.add(child);
}
return node;
}
}
public class Main {
public static void main(String args[]) {
Scanner s=new Scanner(System.in);
GenericTree tree=new GenericTree();
int k=s.nextInt();
}
}