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

class Time
{
    public static final String TIME_SERVER = "www.cs.harvard.edu";
    public static final int    TIME_PORT   = 13;

    public static void main( String [] args )
    {
        try
        {
            Socket t = new Socket( TIME_SERVER, TIME_PORT );

            InputStreamReader in = new InputStreamReader( t.getInputStream( ) );
            BufferedReader is = new BufferedReader( in );

            String str;

            while( ( str = is.readLine( ) ) != null )
                System.out.println( str );
        }
        catch( UnknownHostException e ) // Not really needed
        {                               // UnknownHostException IS-A IOException
            System.out.println( e );
        }
        catch( IOException e )
        {
            System.out.println( e );
        }
    }
}
