class Time(object):
  '''Represents the time of day in the 24-hour notation.
     Attributes: hour, minute, second'''

  def __init__(self, hour=0, minute=0, second=0):
    '''Instantiates a Time object.  Unless specified otherwise, it is 
    initialized to 00:00:00.'''
    self.hour = hour
    self.minute = minute
    self.second = second

  def __str__(self):
    '''Returns a string representation of a Time object.'''
    return '%.2d:%.2d:%.2d' % (self.hour, self.minute, self.second)

  def to_hours(self):
    return self.hour

  def to_minutes(self):
    return self.hour * 60 + self.minute

  def from_hours(self, hours):
    self.hour = hours % 24

  def from_minutes(self, minutes):
    self.hour = (minutes / 60) % 24
    self.minute = minutes % 60

  def h_increment(self, hours):
    self.from_hours(self.to_hours() + hours)

  def m_increment(self, minutes):
    self.from_minutes(self.to_minutes() + minutes)
