class My implements Runnable
{
int i=1;
boolean flag=true;
public void run()
{
while(flag)
{
    try 
    {
     System.out.println (Thread.currentThread().getName()+" sell ticket: "+i);
            i++;
            if(i>100)
            flag=false;
            Thread.sleep(10);
    }
    catch (Exception ex) {
    }
 
    }
}
}
class thread
{
public static void main(String[] args)
{

My my=new My();
Thread thr=new Thread(my);
Thread thr2=new Thread(my);
Thread thr3=new Thread(my);
Thread thr4=new Thread(my);

thr.start();

thr2.start();
thr3.start();
thr4.start();

}
}