from datetime import datetime


def time_of_trip(datum, city):
    """
    Takes as input a dictionary containing info about a single trip (datum) and
    its origin city (city) and returns the month, hour, and day of the week in
    which the trip was made.
    
    Remember that NYC includes seconds, while Washington and Chicago do not.
    
    HINT: You should use the datetime module to parse the original date
    strings into a format that is useful for extracting the desired information.
    see https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior
    """

    month = 0
    hour = 0
    day_of_week = "Sunday"

    date_string = ""
    if datum.get("starttime") is not None:
        date_string = datum["starttime"]  # 1/1/2016 00:09:55, 3/31/2016 23:30
    elif datum.get("Start date") is not None:
        date_string = datum["Start date"]  # 3/31/2016 22:57

    # if there is no seconds parameter in the string add ':00' to it
    if date_string[-6] is not ':':
        date_string += ":00"
    
    date_time_object = datetime.strptime(date_string, "%m/%d/%Y %H:%M:%S")

    month = int(date_time_object.strftime('%m'))
    hour = int(date_time_object.strftime('%H'))
    day_of_week = date_time_object.strftime('%A')
    
    return (month, hour, day_of_week)