import java.text.*; 
  
public class DigitalClock 
{ 
  public static void main(String[] argv) throws Exception 
  { 
    System.out.println("CTRL-C to exit..."); 
    for (int hr = 0; hr < 24; hr++) 
    { 
      for (int min = 0; min < 60; min++) 
      { 
        for (int sec = 0; sec < 60; sec++) 
        { 
          System.out.print("" + new DecimalFormat("00").format(hr)); 
          System.out.print(":" + new DecimalFormat("00").format(min)); 
          System.out.print(":" + new DecimalFormat("00").format(sec) + ' '); 
          System.out.flush(); 
          Thread.sleep(1000); // one second 
          System.out.print('\r'); // carriage return 
        } 
      } 
    } 
  } // main 
} // public class 
