class PingPong extends Thread {
	String word;
	int delay;
	
	PingPong(String whatToSay, int delayTime) {
		word = whatToSay;
		delay = delayTime;
		}
	
	public void run() {
		try {
			for(;;) {
				System.out.print(word + " ");
				sleep(delay);
				}
			}
		catch(InterruptedException e) {
			return;
			}
		}
	public static void main(String[] args) {
			new PingPong("ping",20).start();
			new PingPong("pong",50).start();
		
			}	
		}
		