def opposite_direction(direction):
    """
    Return the opposite direction of the given one. The direction must be one of "up", "down", "left" or "right".
    """
    return {"up": "down", "left": "right", "down": "up", "right": "left"}[direction]