import java.util.*;
public class Client  implements Runnable
{
    public Sender s;
    public Receiver r;
    public int Client_id,count,temp;
  public Client(int  id,int ReceiverRecport,int SenderSendPort)
    {
	//System.out.println(port);
	Client_id=id;
	r=new Receiver(ReceiverRecport);
	s=new Sender(SenderSendPort);
	//int ports[]={1200,1201,1202,1203,1205};
    }


    public void run()
	{
	    while (true)
		{
		    temp=(int)Math.round(Math.random()*5)+1200;
		    System.out.println(temp);
		    s.sendTo(""+Client_id+" "+(count++),temp);

			try
			    {
				Thread.currentThread().sleep(Math.round(Math.random())*10000);
			    } 
		    catch(Exception e)
			{
			    System.out.println(e);
			}  

		}
	}

}
