def str_to_time(time):
    """
        Converts string with time in 'HHMM' format into a pair (hour, minute)
    """
    time_str = str(time).zfill(4)
    hour = int(time_str[:2])
    minute = int(time_str[2:])

    assert 0 <= hour <= 23
    assert 0 <= minute <= 55

    return hour, minute