/* package whatever; // don't place package name! */

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

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	
	public class Node {
    
	    public Node left, right;
	    public int elem;
	    
	    public Node (int val) {
	        this.elem = val;
	    }
	    
	    void insert(int val){
	        if(this.elem < val){
	            if(this.right != null){
	                this.right.insert(val);
	            }
	            else{
	                this.right = new Node(val);
	            }
	        }
	        else if(this.elem > val){
	            if(this.left != null){
	                this.left.insert(val);
	            }
	            else{
	                this.left = new Node(val);
	    
	            }
	        }
	        else {
	            return;
	        }
	    }
	    
	}
	
	public void run () {
	    Random rand = new Random();
	    Node n = new Node(500000);
	    for(int i = 0; i < 100000; i++) {
	        n.insert(rand.nextInt(1000000));
	    }
	}
	
	public static void main (String[] args) throws java.lang.Exception {
		long t = System.currentTimeMillis();
		new Ideone().run();
		System.out.println(System.currentTimeMillis()-t);
	}
}