// 
import java.io.*;
import java.net.*;

class Connexion extends Thread{
  protected Socket client;
  protected BufferedReader in;
  protected PrintStream out;

  public Connexion(Socket client_soc) {
   client=client_soc;
   try {in =new BufferedReader(new InputStreamReader(client.getInputStream()));
        out =new PrintStream(client.getOutputStream());}
   catch (IOException e) {
      try {client.close();} catch (IOException e1) {};
      System.err.println(e.getMessage());
      return;
   }
   this.start();
  }
    
  public void run() {
   String ligne;
   try {
     while(true) {
       	ligne=in.readLine();
	if (ligne.toUpperCase().compareTo("FIN")==0) break; 
	out.println(ligne.toUpperCase());
     }}
    catch (IOException e) 
       {System.out.println("connexion :"+e.toString());}
    finally
       {try {client.close();} catch (IOException e){};}
  }
}