1. 

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

class Main {

public static void main(String...args) throws Exception
{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String input;
int round, fail, guess;
Set<Character> set = new HashSet<Character>();
Set<Character> guesses = new HashSet<Character>();

while( (input = reader.readLine()) != null)
{
guess = 0;
fail = 0;
set.clear();
guesses.clear();

round = Integer.parseInt(input);
if(round == -1)
break;

input = reader.readLine();

for(int i = 0; i < input.length(); i++)
set.add(input.charAt(i));

input = reader.readLine();
for(int i = 0; i < input.length(); i++)
{
if(!guesses.contains(input.charAt(i)))
if(set.contains(input.charAt(i)))
{
guess++;
if(guess >= set.size())
break;
}
else
{
fail++;
if(fail >= 7)
break;
}

guesses.add(input.charAt(i));
}

System.out.println("Round " + round);


if(guess >= set.size())
System.out.println("You win.");
else
if(fail >= 7)
System.out.println("You lose.");
else
System.out.println("You chickened out.");

}
}
}

2.

/**
* FWP: Ausgewaehlte Probleme aus dem ACM (SS10)
*
* Method: ad hoc
* Problem: 489 - Hangman Judge
* Accepted: 2.036
* @author Evgeni Pavlidis
*
*/
import java.util.*;
import java.io.*;

class Main {

public static void main(String...args) throws Exception
{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String input;
int round, fail, guess;
Set<Character> set = new HashSet<Character>();
Set<Character> guesses = new HashSet<Character>();

while( (input = reader.readLine()) != null)
{
guess = 0;
fail = 0;
set.clear();
guesses.clear();

round = Integer.parseInt(input);
if(round == -1)
break;

input = reader.readLine();

for(int i = 0; i < input.length(); i++)
set.add(input.charAt(i));

input = reader.readLine();
for(int i = 0; i < input.length(); i++)
{
if(!guesses.contains(input.charAt(i)))
if(set.contains(input.charAt(i)))
{
guess++;
if(guess >= set.size())
break;
}
else
{
fail++;
if(fail >= 7)
break;
}

guesses.add(input.charAt(i));
}

System.out.println("Round " + round);


if(guess >= set.size())
System.out.println("You win.");
else
if(fail >= 7)
System.out.println("You lose.");
else
System.out.println("You chickened out.");

}
}
}