def back_direction(direction: str):
    """
    Get an opposite direction
    :param direction: initial direction
    :return: opposite direction
    """
    res_direction = None
    if direction == 'up':
        res_direction = 'down'
    elif direction == 'down':
        res_direction = 'up'
    elif direction == 'left':
        res_direction = 'right'
    elif direction == 'right':
        res_direction = 'left'
    return res_direction