class monkey extends basic { public static void main (String param []) throws Exception { input in = new input(); output out = new output(); int count = 1; out.writeln ("Type a three letter word."); char a = in.read(); char b = in.read(); char c = in.read(); random stream = new random (97, 122); char d = (char)stream.readint(); char e = (char)stream.readint(); char f = (char)stream.readint(); String guess = "" + d + e + f; while (!(guess.equals("" + a + b + c))) { d = (char)stream.readint(); e = (char)stream.readint(); f = (char)stream.readint(); guess = "" + d + e + f; count = count + 1; } out.writeln ( "" + a + b + c + " typed after " + count + " attempts."); out.close (); } }