class myT extends Thread {
	public static int i = 0;

	public myT(String fly) { super(fly); }
	public void run() {
		for (int j = 0; j < (int)(Math.random() * 1000); j++)
			i += j*j;
		i = getName().length();
	}
}

class myThread extends Thread {

	public myThread(String fly) { super(fly); }

	public void run() {
		for(int i = 0; i < 10; i++) {
			System.out.println(i + " " + getName());
			try {
				sleep((int)(Math.random() * 1000));
			} catch (InterruptedException e){}
		}
		System.out.println("Done! " + getName());

	}
}


class AppRace {
	public static void main(String args[]) {
		myT t1 = new myT("t1");
		t1.start();
		new myT("ThreadWithVeryLongName").start();
		System.out.println("And the winner is " + t1.i);
	}
}
class App {
	public static void main(String args[]) {
		new myThread("Yowza").start();
		new myThread("Yikes").start();
		new myThread("Alexi").start();
		new myThread("Bowmo").start();
		new myT("schmap").start();
	}
}
