def add_time(start, duration, day = ""):
  days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
  time = start.split(":")
  t = int(time[0]) * 60 

  if 'PM' in time[1]:
    time[1] = time[1].split("PM")
    t += 12*60 + int(time[1][0])
  else:
    time[1] = time[1].split("AM")
    t += int(time[1][0])

  dur = duration.split(":")
  plus = int(dur[0]) * 60 + int(dur[1])

  hours = (t + plus) // 60
  minutes = (t + plus) % 60
  plus_days = 0

  if hours % 12 == 0:
    new_time =  '12:'
  else:
    new_time = str(hours % 12) + ':'

  if minutes < 10:
    new_time += "0" 

  new_time += str(minutes)

  if hours % 24 < 12:
    new_time += ' AM'    
  else:
    new_time += ' PM'

  plus_days = hours // 24 
  new_day = day.capitalize()

  
  if new_day in days:
    new_day = days[(days.index(new_day) + plus_days) % 7]
    new_time += ", " + new_day

  if plus_days == 1:
    new_time += " (next day)"
  elif plus_days > 1:
    new_time += " (" + str(plus_days) + " days later)"

  return new_time
