def update_direction(direction, turn):
    """Return the directions ID after the given turn."""
    answer = None
    if turn == "R":
        answer = (direction + 1) % 4
    elif turn == "L":
        answer = (direction - 1) % 4
    return answer