Died or not Died? - Python

In RPG games it is common scenarios where the character receives a certain amount of damage, and it is necessary to know if the character survived or died after receiving the damage and that is what the code below should do.

class Character:
    def __init__(self, name: str, attack: int, defense: int, life: int):
        self.name = name
        self.attack = attack
        self.defense = defense
        self.life = life

    # Create a method that determines whether or not the character died after receiving the damage.


if __name__ == "__main__":

    name = input()
    attack = int(input())
    defense = int(input())
    life = int(input())

    character = Character(name, attack, defense, life)

    damage = int(input())

    if character.survived(damage):
        print(f"{character.name} sobreviveu!!!")
    else:
        print(f"{character.name} morreu :(")

But precisely the coding that determines whether a character dies or survives after receiving a blow is missing.

Your task is simple to complete the above code 😄.

Input

The input consists of 5 lines. The first line contains the name of the character in question, the second line the attack attribute of the character. The third line contains the defence attribute, the fourth line contains the life points of the character, and the last line contains the amount of damage that the blow will cause.

Output

The output of your program must be the character's name followed by "sobreviveu!!!" (Portuguese for "survived") if the character survives the blow or the character's name followed by "morreu:(" (Portuguese for "died") otherwise.

The final damage is calculated by the damage of the blow minus the character's defence attribute.

Constraints

  • The character name can be up to 40 characters long.
  • The attributes of attack, defence and life vary between 1 and 100.
  • The damage varies between 0 and 200.
Input Samples Output Samples
Ronaldo
4
3
10
12
Ronaldo sobreviveu!!!
Tevez
4
3
10
13
Tevez morreu :(