import java.io.*;
import java.util.*;

public class TwoIslands {
    
    public static void main (String[] args) {
	Runnable jamaica = new IslandChooser("Jamaica");
	Runnable fiji = new IslandChooser("Fiji");
	Thread jam = new Thread(new IslandChooser("Jamaica"));
	Thread fij = new Thread(fiji);
	jam.start();
	fij.start();
    }
}

public class IslandChooser implements Runnable {
        private String name;

	public IslandChooser(String str) {
	    name = str;
	}

	public void run() {
	    for (int i = 0; i < 10; i++) {
		System.out.println(i + " " + name);
		try {
		     Thread.sleep( (int) (Math.random() * 1000));
		} catch (java.lang.InterruptedException ex) {return;}
	    }
	    System.out.println("DONE!" + name);
	}
    
}