package a;
 class Test3 implements Runnable {
    public void run()
    {
        for(int i =0;i<5;i++)
        {  System.out.println( i );
            try{ Thread.sleep(50);
    }catch(InterruptedException e){
        e.printStackTrace();
    }}
}}
class Test2 implements Runnable{
public void run()
{for(int i=5;i>0;i--){
  System.out.println( i);
   try{ Thread.sleep(50);
    }catch(InterruptedException e){
        e.printStackTrace();
    }}
 }
}
public class Test1{
public static void main(String args[]){
    Test3 lx =new Test3();
   Test2 lx1 = new Test2();
   Thread t1 = new Thread(lx);
   Thread t2 = new Thread(lx1);
   t1.run();
   t2.run();}
}