from axelrod.action import Action
from axelrod.player import Player
lllllIll, lIIlIIIlllIl = Action.C, Action.D
class lIlIlllIl(Player):
    lllIlllllIllIlIll = "strategy"
    lIIIIlIlllIlllIl = {
        "memory_depth": float("inf"),  
        "stochastic": False,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def __init__(
        IIIlllIIllIIl,
        lIIlIIIlIlIIIlllllIl: str = "Nice",
        IIllIlIllI: int = 10,
        IIIIllllIlI: int = -10,
    ) -> None:
        super().__init__()
        IIIlllIIllIIl.IIlIlIIIlll = lIIlIIIlIlIIIlllllIl
        IIIlllIIllIIl.IIllIlIllI = IIllIlIllI
        IIIlllIIllIIl.IIIIllllIlI = IIIIllllIlI
    def llllIIII(IIIlllIIllIIl, IlIlIlIlIIl: Player) -> Action:
        lIIlIIIlIIIIIlIl = IlIlIlIlIIl.defections - IlIlIlIlIIl.cooperations
        if IIIlllIIllIIl.IIlIlIIIlll == "Nice":
            if lIIlIIIlIIIIIlIl > IIIlllIIllIIl.IIllIlIllI:
                IIIlllIIllIIl.IIlIlIIIlll = "Grumpy"
                return lIIlIIIlllIl
            return lllllIll
        if IIIlllIIllIIl.IIlIlIIIlll == "Grumpy":
            if lIIlIIIlIIIIIlIl < IIIlllIIllIIl.IIIIllllIlI:
                IIIlllIIllIIl.IIlIlIIIlll = "Nice"
                return lllllIll
            return lIIlIIIlllIl