import java.io.*;

class SimpleThread implements Runnable {
  private String s;
  public SimpleThread(String s) {
    this.s=s;
  }
  public void run() {
    for(int i=0; i<10; i++) {
      System.out.println(s+" "+i);
      try {
        Thread.currentThread().sleep((int)(Math.random()*1000));
      }
      catch (InterruptedException e) {}
    }
    System.out.println(s+" Done!");
  }

  public static void main(String args[]) {
    (new Thread(new SimpleThread("One"))).start();
    (new Thread(new SimpleThread("Two"))).start();
  }
}

