def numbertoampm(hour: int, minute: int) -> tuple:
    """
    Convert time in hh:mm format to AM/PM.
    """
    if hour < 12 or hour == 24:
        period = 'AM'
    else:
        period = 'PM'
    hour = hour % 12
    if hour == 0:
        hour = 12
    return (hour, minute, period)