print("Welcome to Treasure Island.\nYour mission is to find the treasure.")

if input("left or right?\n").lower() != "left":
    exit("Fall into a hole.\nGame over")

if input("swim or wait?\n").lower() != "wait":
    exit("Attacked by trout.\nGame Over.")

last_choice = input("there are three doors: red, blue, yellow. which do you pick\n").lower()

if last_choice == "red":
    exit("Burned by fire.\nGame Over.")
elif last_choice == "yellow":
    exit("You win!")
elif last_choice == "blue":
    exit("Eaten by beasts.\nGame Over.")
else:
    exit("Game over.")