import typing


def previous_hour(day: int, hour: int) -> typing.Tuple[int, int]:
    """Gets the previous hour with wrap."""
    hour -= 1
    if hour < 0:
        hour = 23
        day -= 1
        if day < 0:
            day = 6
    return day, hour